FTE: Considerable Protocol Optimizations

This commit is contained in:
MotoLegacy 2024-01-13 21:47:02 -05:00
parent 5a4ea035d3
commit 4deeb465ee
16 changed files with 252 additions and 269 deletions

View file

@ -92,9 +92,12 @@ float Hitmark_time;
float crosshair_spread_time;
float crosshair_pulse_grenade;
float zoom_2_time;
float broadcast_time;
float broadcast_type;
string broadcast_string;
float broadcast_num;
string character_name;
var struct revive_s {
float draw;

View file

@ -357,7 +357,7 @@ void(float width, float height) HUD_CharacterName =
alpha = (nameprint_time - time);
}
drawstring([x, height - 92 - ((getstatf(STAT_PLAYERNUM) - 1) * 25)], getstats(STAT_PLAYERNAME), [12, 12], [1, 1, 1], alpha, 0);
drawstring([x, height - 92 - ((getstatf(STAT_PLAYERNUM) - 1) * 25)], character_name, [12, 12], [1, 1, 1], alpha, 0);
}
/*******************
@ -1047,11 +1047,57 @@ void(float width, float height) HUD_Useprint =
int perk_order[9];
int current_perk_order;
void() UpdatePerks =
{
float new_perks = getstatf(STAT_PERKS);
if (perks == new_perks)
return;
float s;
// avoids out of bounds err - moto
if (new_perks == 0)
current_perk_order = 0;
for(float i = 1; i < 129; i *= 2) {
if (new_perks & i && !(perks & i)) {
perk_order[current_perk_order] = i;
current_perk_order += 1;
}
}
for(float i = 1; i < 129; i *= 2) {
if (perks & i && !(new_perks & i))
{
for(s = 0; s < 8; s++)
{
if (perk_order[s] == i)
{
perk_order[s] = 0;
while (perk_order[s+1])
{
perk_order[s] = perk_order[s+1];
perk_order[s+1] = 0;
}
break;
}
}
}
}
perks = new_perks;
}
void(float width, float height) HUD_Perks =
{
float scale;
float x, y;
// Update Perk Order.
UpdatePerks();
scale = 32;
@ -1364,15 +1410,27 @@ void() HUD_Powerups =
}
}
void() HUD_Broadcast = {
void() HUD_Broadcast =
{
string broadcast_msg = "";
float health = getstatf(STAT_HEALTH);
string broadcast_name = getplayerkeyvalue(broadcast_num - 1, "name");
switch(broadcast_type) {
case 2: broadcast_msg = strcat(broadcast_string, " needs to be revived"); break;
case 3: broadcast_msg = strcat(broadcast_string, " is reviving you"); break;
default: break;
case CSQC_BROADCAST_PLAYERDOWNED:
broadcast_msg = strcat(broadcast_name, " needs to be revived");
break;
case CSQC_BROADCAST_BEINGREVIVED:
broadcast_msg = strcat(broadcast_name, " is reviving you");
break;
case CSQC_BROADCAST_REVIVINGPLAYER:
broadcast_msg = strcat("Reviving ", broadcast_name);
break;
case CSQC_BROADCAST_NONE:
broadcast_msg = "";
break;
default:
broadcast_msg = "Bad broadcast.";
break;
}
float print_width = stringwidth (broadcast_msg, 0, [0.015*g_width, 0.015*g_width, 0]);
@ -1380,7 +1438,7 @@ void() HUD_Broadcast = {
if (broadcast_msg != "")
drawstring([x, g_height/2, 0], broadcast_msg, [0.015*g_width, 0.015*g_width, 0], [1, 1, 1], 1, 0);
}
};
void() HUD_Scores =
{
@ -1763,40 +1821,4 @@ void(float width, float height) HUD_Draw =
if (fade_time > time)
HUD_Fade();
}
void UpdatePerks(float newperks) {
float s;
// avoids out of bounds err - moto
if (newperks == 0)
current_perk_order = 0;
for(float i = 1; i < 129; i *= 2) {
if (newperks & i && !(perks & i)) {
perk_order[current_perk_order] = i;
current_perk_order += 1;
}
}
for(float i = 1; i < 129; i *= 2) {
if (perks & i && !(newperks & i))
{
for(s = 0; s < 8; s++)
{
if (perk_order[s] == i)
{
perk_order[s] = 0;
while (perk_order[s+1])
{
perk_order[s] = perk_order[s+1];
perk_order[s+1] = 0;
}
break;
}
}
}
}
perks = newperks;
}
}

View file

@ -157,7 +157,7 @@ noref void() CSQC_WorldLoaded =
{
Achievement_Init();
Particles_Init();
nameprint_time = time + 12;
nameprint_time = time + 8;
huddir = "gfx/hud/";
};
@ -872,6 +872,41 @@ noref void() CSQC_Parse_Event =
vector particle_pos = [part_pos_x, part_pos_y, part_pos_z];
Particles_RunParticle(particle_type, particle_pos, part_optional, part_entity);
break;
case CSQC_EVENT_USEPRINT:
useprint_type = readbyte();
useprint_cost = readshort();
useprint_weapon = readbyte();
useprint_time = time + 0.1;
break;
case CSQC_EVENT_ROUNDCHANGE:
rounds = readbyte();
HUD_Change_time = time + 6;
break;
case CSQC_EVENT_BROADCASTMESSAGE:
broadcast_type = readbyte();
broadcast_time = time + readbyte();
broadcast_num = readbyte();
break;
case CSQC_EVENT_MAXAMMOTEXT:
scrolltext = "MAX AMMO!";
stext = true;
break;
case CSQC_EVENT_MUSICSTREAM:
string track_name = readstring();
localsound_enhanced(strcat("tracks/", track_name, ".ogg"), CHAN_MUSIC, 1);
break;
case CSQC_EVENT_GIVEACHIEVEMENT:
float achievement_id = readbyte();
// Don't unlock an existing achievement or any if on emscripten.
if (achievements[achievement_id].unlocked || platform_is_web)
return;
Achievement_Unlock(achievement_id);
break;
case CSQC_EVENT_PLAYERNAME:
character_name = readstring();
break;
case EVENT_WEAPONRECOIL:
local vector rec;
rec_x = readcoord()/5;
@ -886,30 +921,9 @@ noref void() CSQC_Parse_Event =
string message = readstring();
Chat_Register(sender, player_id, message);
break;
case EVENT_USEPRINT:
useprint_type = readbyte();
useprint_cost = readshort();
useprint_weapon = readbyte();
useprint_time = time + 0.1;
break;
case EVENT_ENDGAME:
game_over = true;
break;
case EVENT_NEWROUND:
rounds = readbyte();
HUD_Change_time = time + 6;
break;
case EVENT_SETROUND:
rounds = readbyte();
break;
case EVENT_PERK:
float newperks;
newperks = readlong();
UpdatePerks(newperks);
break;
case EVENT_DOUBLETAPUPDATE:
double_tap_version = readbyte();
break;
@ -938,11 +952,6 @@ noref void() CSQC_Parse_Event =
break;
}
break;
case EVENT_BROADCAST:
broadcast_time = readbyte();
broadcast_type = readbyte();
broadcast_string = readstring();
break;
case EVENT_REVIVECHANGE:
float revivechange_id = readbyte();
float state = readbyte();
@ -974,10 +983,6 @@ noref void() CSQC_Parse_Event =
fade_time = readbyte();
fade_type = readbyte();
break;
case EVENT_SCROLLTEXT:
scrolltext = readstring();
stext = TRUE;
break;
case EVENT_WORLDDATA:
chaptertitle = readstring();
location = readstring();
@ -987,26 +992,6 @@ noref void() CSQC_Parse_Event =
if (chaptertitle == "")
chaptertitle = "'Nazi Zombies'";
break;
case EVENT_SONGPLAY:
string track_name = readstring();
localsound_enhanced(strcat("tracks/", track_name, ".ogg"), CHAN_MUSIC, 1);
break;
case EVENT_ACHIEVEMENT:
float ach = readbyte();
if (achievements[ach].unlocked == true)
return;
Achievement_Unlock(ach);
break;
case EVENT_ACHIEVEMENTPROGRESS:
float id = readbyte();
float pg = readfloat();
if (achievements[id].unlocked == true)
return;
Achievement_UpdateProgress(id, pg);
break;
case EVENT_PLAYERUPDATE:
player_count = readbyte();
break;

View file

@ -61,7 +61,7 @@ void() Particles_MuzzleflashCallback =
// Move to match ADS position if Zoomed in.
if(getstatf(STAT_WEAPONZOOM) == 1) {
muzzleflash_offset += GetWeaponADSOfs_PSP(getstatf(STAT_ACTIVEWEAPON))/1000;
muzzleflash_offset += GetWeaponADSOfs(getstatf(STAT_ACTIVEWEAPON))/1000;
}
muzzleflash_position += v_forward * muzzleflash_offset_z;

View file

@ -234,7 +234,7 @@ vector() ViewModel_GetADSPosition =
if (client_zoom == 1 || client_zoom == 2) {
// These are ordered differently in QuakeC because ??
// right, up, forward
vector temp_adsofs = GetWeaponADSOfs_PSP(getstatf(STAT_ACTIVEWEAPON));
vector temp_adsofs = GetWeaponADSOfs(getstatf(STAT_ACTIVEWEAPON));
// Translate to proper order, and re-gain precision.
ads_offset[0] = temp_adsofs[2]/1000;

View file

@ -104,7 +104,7 @@ void(float mode, entity to) ReportMapMode = {
void(entity to, float type, float cost, float weapon) useprint = {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_USEPRINT);
WriteByte(MSG_MULTICAST, CSQC_EVENT_USEPRINT);
WriteByte(MSG_MULTICAST, type);
WriteShort(MSG_MULTICAST, cost);
WriteByte(MSG_MULTICAST, weapon);
@ -115,7 +115,7 @@ void(entity to, float type, float cost, float weapon) useprint = {
void(string track_name) songegg =
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_SONGPLAY);
WriteByte(MSG_MULTICAST, CSQC_EVENT_MUSICSTREAM);
WriteString(MSG_MULTICAST, track_name);
multicast('0 0 0', MULTICAST_ALL);
};
@ -137,41 +137,23 @@ void(vector org) CallExplosion = {
#endif // FTE
}
void NotifyNewRound(float to) {
#ifdef FTE
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_NEWROUND);
WriteByte(MSG_MULTICAST, to);
multicast('0 0 0', MULTICAST_ALL);
#endif // FTE
}
void SetRound(entity client, float to) {
#ifdef FTE
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_SETROUND);
WriteByte(MSG_MULTICAST, to);
msg_entity = client;
multicast('0 0 0', MULTICAST_ONE);
#endif // FTE
}
void SetPerk(entity client, float to)
//
// FTE_IncrementRound()
// Alerts all clients of new value for Rounds.
// -- RELIABLE --
//
void(float round) FTE_IncrementRound =
{
#ifdef FTE
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_PERK);
WriteLong(MSG_MULTICAST, to);
msg_entity = client;
multicast('0 0 0', MULTICAST_ONE);
WriteByte(MSG_MULTICAST, CSQC_EVENT_ROUNDCHANGE);
WriteByte(MSG_MULTICAST, round);
multicast('0 0 0', MULTICAST_ALL_R);
};
#endif // FTE
}
void(float index, float state) ChangeReviveIconState =
{
@ -213,21 +195,6 @@ void(float index) DisableReviveIcon =
#endif // FTE
}
void(entity who, float broadcast_time, float type, string str) BroadcastMessageToClient =
{
#ifdef FTE
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_BROADCAST);
WriteByte(MSG_MULTICAST, broadcast_time);
WriteByte(MSG_MULTICAST, type);
WriteString(MSG_MULTICAST, str);
msg_entity = who;
multicast('0 0 0', MULTICAST_ONE);
#endif // FTE
}
void(entity who, float weapon) CL_SendWeaponFire =
{
float recoil_return_time = getWeaponRecoilReturn(weapon);
@ -257,19 +224,31 @@ void(entity who, float weapon) CL_SendWeaponFire =
self.recoil_delay = 60/recoil_return_time + time;
}
void(float broadcast_time, float type, string str) BroadcastMessage =
{
#ifdef FTE
//
// FTE_BroadcastMessage(target, broadcast_type, broadcast_type, player_id)
// Sends a CSQC Event to display text on the screen for the
// desired clients. Use 'world' to send to everyone.
// -- RELIABLE --
//
void(entity target, float broadcast_type, float broadcast_time, float player_id) FTE_BroadcastMessage =
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_BROADCAST);
WriteByte(MSG_MULTICAST, CSQC_EVENT_BROADCASTMESSAGE);
WriteByte(MSG_MULTICAST, broadcast_type);
WriteByte(MSG_MULTICAST, broadcast_time);
WriteByte(MSG_MULTICAST, type);
WriteString(MSG_MULTICAST, str);
multicast('0 0 0', MULTICAST_ALL);
WriteByte(MSG_MULTICAST, player_id);
if (target != world) {
msg_entity = target;
multicast('0 0 0', MULTICAST_ONE_R);
} else {
multicast('0 0 0', MULTICAST_ALL_R);
}
};
#endif // FTE
}
void(float count) UpdatePlayerCount = {
#ifdef FTE
@ -417,20 +396,29 @@ void(entity person) FTE_UpdateDynamicFOV =
#ifdef FTE
void(string msg, entity who) ScrollText = {
if (player_count == 0) {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_SCROLLTEXT);
WriteString(MSG_MULTICAST, msg);
msg_entity = who;
multicast('0 0 0', MULTICAST_ONE);
} else {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_SCROLLTEXT);
WriteString(MSG_MULTICAST, msg);
multicast('0 0 0', MULTICAST_ALL);
}
}
//
// nzp_maxammo()
// FTE equivalent of nzp_maxammo builtin.
//
void() nzp_maxammo =
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, CSQC_EVENT_MAXAMMOTEXT);
multicast('0 0 0', MULTICAST_ALL);
};
//
// nzp_setplayername(target, player_name)
// FTE equivalent of nzp_setplayername builtin.
//
void(entity target, string player_name) nzp_setplayername =
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, CSQC_EVENT_PLAYERNAME);
WriteString(MSG_MULTICAST, player_name);
msg_entity = target;
multicast('0 0 0', MULTICAST_ONE);
};
void(string chaptertitle, string location, string date, string person, entity who) WorldText = {
if (player_count == 0) {
@ -475,7 +463,7 @@ void (float achievement_id, optional entity who) GiveAchievement =
#else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENT);
WriteByte(MSG_MULTICAST, CSQC_EVENT_GIVEACHIEVEMENT);
WriteByte(MSG_MULTICAST, achievement_id);
msg_entity = who;
multicast('0 0 0', MULTICAST_ONE);
@ -496,7 +484,7 @@ void (float achievement_id, optional entity who) GiveAchievement =
#else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENT);
WriteByte(MSG_MULTICAST, CSQC_EVENT_GIVEACHIEVEMENT);
WriteByte(MSG_MULTICAST, achievement_id);
multicast('0 0 0', MULTICAST_ALL);
@ -545,64 +533,6 @@ float Player_SendEntity( entity ePVEnt, float flChanged ) {
return TRUE;
}
#endif // FTE
void (float achievement_id, float progress_value, optional entity who) UpdateAchievementProgress =
{
#ifndef FTE
// temp
if (achievement_id > 4)
return;
#endif // FTE
// this is a progress update specific to an individual
if ((who && who != world) || player_count == 0) {
if (player_count == 0) who = find(world, classname, "player");
#ifndef FTE
//achievement_progress(who, achievement_id, progress_value);
#else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENTPROGRESS);
WriteByte(MSG_MULTICAST, achievement_id);
WriteFloat(MSG_MULTICAST, progress_value);
msg_entity = who;
multicast('0 0 0', MULTICAST_ONE);
#endif // FTE
} else {
#ifndef FTE
entity players;
players = find(world, classname, "player");
while(players != world) {
//achievement_progress(players, achievement_id, progress_value);
players = find(players, classname, "player");
}
#else
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENTPROGRESS);
WriteByte(MSG_MULTICAST, achievement_id);
WriteFloat(MSG_MULTICAST, progress_value);
multicast('0 0 0', MULTICAST_ALL);
#endif // FTE
}
}
#ifdef FTE
void(entity who, float version) nzp_setdoubletapver =
{
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);

View file

@ -144,7 +144,6 @@ void() EndGameSetup =
NotifyGameEnd();
}
game_over = true;
SetPerk(self, self.perks);
addmoney(self, -self.points, 0);
addmoney(self, self.score, 0);
return;
@ -216,8 +215,12 @@ void() GetDown =
addmoney(self, point_difference * -1, false);
self.requirespower = point_difference;
// Broadcast that the player has downed.
BroadcastMessage(time + 3, 2, self.netname);
#ifdef FTE
// FTE-Specific: Broadcast that the player has downed to everyone.
FTE_BroadcastMessage(world, CSQC_BROADCAST_PLAYERDOWNED, 3, self.playernum);
#endif // FTE
// Reset state
self.velocity = self.zoom = 0;
@ -238,11 +241,19 @@ void() GetDown =
self.progress_bar = 10 + time;
self.progress_bar_time = 10;
self.progress_bar_percent = 1;
#ifdef FTE
// FTE-Specific: Broadcast to the player they're reviving themselves.
FTE_BroadcastMessage(self, CSQC_BROADCAST_REVIVINGPLAYER, 3, self.playernum);
#endif // FTE
}
// Take away weapons and Perks
self.perks = 0;
SetPerk(self, self.perks);
self.weaponbk = self.weapon;
self.currentammobk = self.weapons[0].weapon_reserve;

View file

@ -119,8 +119,6 @@ void GivePerk(optional float p) {
self.perk_delay = self.fire_delay;
Weapon_PlayViewModelAnimation(ANIM_TAKE_OUT, ReturnWeaponModel, 0);
SetPerk(self, self.perks);
}
//

View file

@ -558,17 +558,8 @@ void() PU_MaxAmmo =
}
// MAX AMMO! text
#ifdef FTE
ScrollText("MAX AMMO!", players);
#else
nzp_maxammo();
#endif // FTE
players = find(players, classname, "player");
}
};

View file

@ -342,7 +342,7 @@ void() worldspawn =
clientstat(STAT_FACINGENEMY, EV_FLOAT, facingenemy);
clientstat(STAT_VIEWZOOM, EV_FLOAT, viewzoom);
clientstat(STAT_MAXHEALTH, EV_FLOAT, max_health);
clientstat(STAT_PLAYERNAME, EV_STRING, name);
clientstat(STAT_PERKS, EV_FLOAT, perks);
#endif // FTE

View file

@ -561,13 +561,9 @@ void() PlayerPostThink =
if(self.isspec)
return;
#ifndef FTE
if (time < 5 && self.name != "")
nzp_setplayername(self, self.name);
#endif // FTE
//landsound
if((self.oldvelocity_z < -212) && (self.flags & FL_ONGROUND))
{
@ -893,7 +889,6 @@ void() PlayerSpawn =
self.stamina = 3;
self.reviving = 0;
self.perks = G_PERKS;
SetPerk(self, self.perks);
if (rounds < 1 && player_count == 0) {
sound(self, CHAN_AUTO, "sounds/rounds/splash.wav", 1, ATTN_NONE);
@ -905,7 +900,6 @@ void() PlayerSpawn =
#ifdef FTE
SetRound(self, G_STARTROUND);
self.viewzoom = 1;
self.SendEntity = Player_SendEntity;
self.weapon_animduration = getWeaponDelay(self.weapon, FIRE);
@ -920,7 +914,7 @@ void() PlayerSpawn =
self.Weapon_Name = GetWeaponName(self.weapon);
self.Flash_Offset = GetWeaponFlash_Offset(self.weapon);
self.Flash_Size = GetWeaponFlash_Size(self.weapon);
self.ADS_Offset = GetWeaponADSOfs_PSP(self.weapon);
self.ADS_Offset = GetWeaponADSOfs(self.weapon);
#endif // FTE

View file

@ -213,7 +213,13 @@ void() NewRound =
rounds = rounds + 1;
NotifyNewRound(rounds);
#ifdef FTE
// FTE-Specific - alert CSQC of the round increment for HUD display
FTE_IncrementRound(rounds);
#endif // FTE
tempe = find(world, classname, "player");
while (tempe)
{

View file

@ -270,7 +270,7 @@ void Weapon_SwapWeapons(float play_animation)
self.Weapon_Name = GetWeaponName(self.weapon);
self.Flash_Offset = GetWeaponFlash_Offset(self.weapon);
self.Flash_Size = GetWeaponFlash_Size(self.weapon);
self.ADS_Offset = GetWeaponADSOfs_PSP(self.weapon);
self.ADS_Offset = GetWeaponADSOfs(self.weapon);
#endif // FTE
@ -304,7 +304,7 @@ void Weapon_SetActiveInSlot(float slot, float play_first_raise)
self.Weapon_Name = GetWeaponName(self.weapon);
self.Flash_Offset = GetWeaponFlash_Offset(self.weapon);
self.Flash_Size = GetWeaponFlash_Size(self.weapon);
self.ADS_Offset = GetWeaponADSOfs_PSP(self.weapon);
self.ADS_Offset = GetWeaponADSOfs(self.weapon);
#endif // FTE

View file

@ -1751,8 +1751,16 @@ void() CheckPlayer =
if (ent.beingrevived == true && ent.firer != self)
return;
// Broadcast that they're being revived
BroadcastMessageToClient(ent, time + 2, 3, self.netname);
#ifdef FTE
// FTE-Specific: Broadcast to the player they're being revived.
FTE_BroadcastMessage(ent, CSQC_BROADCAST_BEINGREVIVED, 2, self.playernum);
// FTE-Specific: Broadcast to client that they are reviving the downed player.
FTE_BroadcastMessage(self, CSQC_BROADCAST_REVIVINGPLAYER, 2, ent.playernum);
#endif // FTE
ent.speed_penalty = 0.01;
ent.speed_penalty_time = time + 100;
@ -1786,6 +1794,16 @@ void() CheckPlayer =
self.progress_bar_percent = 0;
self.revived = 0;
addmoney(self, ent.requirespower, false);
#ifdef FTE
// FTE-Specific: End Broadcast Messages on both ends
FTE_BroadcastMessage(ent, CSQC_BROADCAST_NONE, 0, self.playernum);
FTE_BroadcastMessage(self, CSQC_BROADCAST_NONE, 0, ent.playernum);
#endif // FTE
}
}
else if (self.downed || (!self.button7 && self.reviving) || (self.reviving && self.active_door != ent) || ent.classname == "disconnected") {
@ -1803,6 +1821,15 @@ void() CheckPlayer =
self.progress_bar_percent = 0;
self.revived = 0;
self.reviving = 0;
#ifdef FTE
// FTE-Specific: End Broadcast Messages on both ends
FTE_BroadcastMessage(ent, CSQC_BROADCAST_NONE, 0, self.playernum);
FTE_BroadcastMessage(self, CSQC_BROADCAST_NONE, 0, ent.playernum);
#endif // FTE
}
}
else if(ent.classname == "player" && ent != self && !ent.downed) // small player push

View file

@ -37,6 +37,14 @@
#define CSQC_PART_ZOMBIEGIB 3 // Zombie Gib effect.
#define CSQC_PART_FIRE 4 // Fire/flame effect.
//
// CSQC Broadcast Messages
//
#define CSQC_BROADCAST_NONE 0 // ""
#define CSQC_BROADCAST_PLAYERDOWNED 1 // "$ needs to be revived"
#define CSQC_BROADCAST_BEINGREVIVED 2 // "$ is reviving you"
#define CSQC_BROADCAST_REVIVINGPLAYER 3 // "Reviving $"
//
// CSQC Event Types
//
@ -47,24 +55,32 @@
// <byte> optional_field
// <entity> optional_entity
#define EVENT_USEPRINT 11
#define EVENT_NEWROUND 12
#define EVENT_SETROUND 13
#define EVENT_PERK 14
#define EVENT_UPDATE 15
#define EVENT_BROADCAST 16
#define EVENT_POINTUPDATE 17
#define EVENT_BLACKOUT 18
#define EVENT_SCROLLTEXT 19
#define CSQC_EVENT_USEPRINT 11 // <byte> useprint_type
// <short> useprint_cost
// <byte> useprint_weapon
#define CSQC_EVENT_ROUNDCHANGE 12 // <byte> round
#define CSQC_EVENT_BROADCASTMESSAGE 13 // <byte> broadcast_message_type
// <byte> broadcast_time
// <byte> player_number
#define CSQC_EVENT_MAXAMMOTEXT 14 // NO DATA.
#define CSQC_EVENT_MUSICSTREAM 15 // <string> track_name
#define CSQC_EVENT_GIVEACHIEVEMENT 16 // <byte> achievement_index
#define CSQC_EVENT_PLAYERNAME 17 // <string> player_name
#define EVENT_UPDATE 18
#define EVENT_BLACKOUT 19
#define EVENT_WORLDDATA 20
#define EVENT_ACHIEVEMENT 21
#define EVENT_PLAYERUPDATE 22
#define EVENT_ACHIEVEMENTPROGRESS 23
#define EVENT_REVIVEON 24
#define EVENT_REVIVEOFF 25
#define EVENT_REVIVECHANGE 26
#define EVENT_WEAPONRECOIL 27
#define EVENT_SONGPLAY 28
#define EVENT_GRENADEPULSE 29
#define EVENT_BETTYPROMPT 30
#define EVENT_CHATMESSAGE 31
@ -266,8 +282,8 @@ float map_compatibility_mode;
#define STAT_PLAYERSTANCE 65
#define STAT_FACINGENEMY 66
#define STAT_MAXHEALTH 67
#define STAT_PLAYERNAME 68
#define STAT_WEAPONSKIN 69
#define STAT_WEAPONSKIN 68
#define STAT_PERKS 69
.float playernum;
float game_over;

View file

@ -1543,7 +1543,7 @@ Weapon PSP ADS Declarations
// x: left/right
// y: up/down
// z: forward/back
vector GetWeaponADSOfs_PSP(float wep) =
vector GetWeaponADSOfs(float wep) =
{
switch(wep)