}
void AnnounceTo(entity e, string snd) {
- if (clienttype(e) == CLIENTTYPE_REAL)
+ if (IS_REAL_CLIENT(e))
{
msg_entity = e;
WriteByte(MSG_ONE, SVC_TEMPENTITY);
entity e;
e = to;
- if(to.classname == "spectator")
+ if(IS_SPEC(to))
e = to.enemy;
sf = 0;
FOR_EACH_REALCLIENT(e2)
{
if(e2 != e)
- if(e2.classname == "spectator")
+ if(IS_SPEC(e2))
if(e2.enemy == e)
e2.clientdata.SendFlags = 1;
}
if(spot.target == "")
return '-1 0 0';
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
{
if(spot.restriction == 1)
return '-1 0 0';
error("No spawnpoints for observers?!?\n");
RemoveGrapplingHook(self); // Wazat's Grappling Hook
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
{
msg_entity = self;
WriteByte(MSG_ONE, SVC_SETVIEW);
void PutClientInServer (void)
{
- if(clienttype(self) == CLIENTTYPE_BOT)
+ if(IS_BOT_CLIENT(self))
{
self.classname = "player";
if(g_ca)
self.caplayer = 1;
}
- else if(clienttype(self) == CLIENTTYPE_REAL)
+ else if(IS_REAL_CLIENT(self))
{
msg_entity = self;
WriteByte(MSG_ONE, SVC_SETVIEW);
if(gameover)
self.classname = "observer";
- if(self.classname == "player" && (!g_ca || (g_ca && allowed_to_spawn))) {
+ if(IS_PLAYER(self) && (!g_ca || (g_ca && allowed_to_spawn))) {
entity spot, oldself;
float j;
self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
if(autocvar_g_playerclip_collisions)
self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
- if(clienttype(self) == CLIENTTYPE_BOT && autocvar_g_botclip_collisions)
+ if(IS_BOT_CLIENT(self) && autocvar_g_botclip_collisions)
self.dphitcontentsmask |= DPCONTENTS_BOTCLIP;
self.frags = FRAGS_PLAYER;
if(INDEPENDENT_PLAYERS)
if (autocvar_g_spawnsound)
soundat(world, self.origin, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTN_NORM);
- } else if(self.classname == "observer") {
+ } else if(IS_OBSERVER(self)) {
PutObserverInServer ();
}
}
{
if(self.cnt <= 10)
setmodel(self, strcat("models/sprites/", ftos(self.cnt), ".spr32"));
- if(clienttype(self.owner) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self.owner))
{
if(self.cnt <= 10)
AnnounceTo(self.owner, strcat(ftos(self.cnt), ""));
self.clientkill_nexttime = time + killtime + autocvar_g_balance_kill_antispam;
}
- if(killtime <= 0 || self.classname != "player" || self.deadflag != DEAD_NO)
+ if(killtime <= 0 || !IS_PLAYER(self) || self.deadflag != DEAD_NO)
{
ClientKill_Now();
}
if(targetteam == 0) // just die
{
self.killindicator.colormod = '0 0 0';
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
if(self.killindicator.cnt > 0)
Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, "^1Suicide in %d seconds", 1, self.killindicator.cnt);
}
else if(targetteam == -1) // auto
{
self.killindicator.colormod = '0 1 0';
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
if(self.killindicator.cnt > 0)
Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, "Changing team in %d seconds", 1, self.killindicator.cnt);
}
else if(targetteam == -2) // spectate
{
self.killindicator.colormod = '0.5 0.5 0.5';
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
if(self.killindicator.cnt > 0)
Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, "Spectating in %d seconds", 1, self.killindicator.cnt);
}
else
{
self.killindicator.colormod = TeamColor(targetteam);
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
if(self.killindicator.cnt > 0)
Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, strcat("Changing to ", ColoredTeamName(targetteam), " in %d seconds"), 1, self.killindicator.cnt);
}
if (gameover)
return;
- if((g_arena || g_ca) && ((champion && champion.classname == "player" && player_count > 1) || player_count == 1)) // don't allow a kill in this case either
+ if((g_arena || g_ca) && ((champion && IS_PLAYER(champion) && player_count > 1) || player_count == 1)) // don't allow a kill in this case either
{
// do nothing
}
{
float t;
- if(self.flags & FL_CLIENT)
+ if(IS_CLIENT(self))
{
print("Warning: ClientConnect, but already connected!\n");
return;
// identify the right forced team
if(autocvar_g_campaign)
{
- if(clienttype(self) == CLIENTTYPE_REAL) // only players, not bots
+ if(IS_REAL_CLIENT(self)) // only players, not bots
{
switch(autocvar_g_campaign_forceteam)
{
PlayerStats_AddEvent(sprintf("kills-%d", self.playerid));
- if(clienttype(self) == CLIENTTYPE_BOT)
+ if(IS_BOT_CLIENT(self))
PlayerStats_AddPlayer(self);
if(autocvar_sv_eventlog)
- GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((clienttype(self) == CLIENTTYPE_REAL) ? self.netaddress : "bot"), ":", self.netname));
+ GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot"), ":", self.netname));
LogTeamchange(self.playerid, self.team, 1);
bprint("^4", self.netname, "^4 connected");
- if(self.classname != "observer" && (g_domination || g_ctf))
+ if(!IS_OBSERVER(self) && (g_domination || g_ctf))
bprint(" and joined the ", ColoredTeamName(self.team));
bprint("\n");
self.jointime = time;
self.allowed_timeouts = autocvar_sv_timeout_number;
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
{
if(autocvar_g_bugrigs || WEPSET_EQ_AW(g_weaponarena_weapons, WEP_TUBA))
stuffcmd(self, "cl_cmd settemp chase_active 1\n");
self.model_randomizer = random();
- if(clienttype(self) != CLIENTTYPE_REAL)
+ if not(IS_REAL_CLIENT(self))
return;
sv_notice_join();
if(self.vehicle)
vehicles_exit(VHEF_RELESE);
- if not(self.flags & FL_CLIENT)
+ if not(IS_CLIENT(self))
{
print("Warning: ClientDisconnect without ClientConnect\n");
return;
void play_countdown(float finished, string samp)
{
- if(clienttype(self) == CLIENTTYPE_REAL)
+ if(IS_REAL_CLIENT(self))
if(floor(finished - time - frametime) != floor(finished - time))
if(finished - time < 6)
sound (self, CH_INFO, samp, VOL_BASE, ATTN_NORM);
if (self == self.enemy)
return 0;
- if(self.enemy.classname != "player")
+ if not(IS_PLAYER(self.enemy))
return 0;
SpectateCopy(self.enemy);
if (other)
self.enemy = other;
- if(self.enemy.classname == "player") {
+ if(IS_PLAYER(self.enemy)) {
/*if(self.enemy.vehicle)
{
PutClientInServer();
- if(self.classname == "player")
+ if(IS_PLAYER(self))
bprint ("^4", self.netname, "^4 is playing now\n");
if(!autocvar_g_campaign)
* g_maxplayers_spectator_blocktime seconds
*/
void checkSpectatorBlock() {
- if(self.classname == "spectator" || self.classname == "observer") {
+ if(IS_SPEC(self) || IS_OBSERVER(self)) {
if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
sprint(self, "^7You were kicked from the server because you are spectator and spectators aren't allowed at the moment.\n");
dropclient(self);
{
if (self.motd_actived_time == 0) { // is there already a message showing?
if (autocvar_g_campaign) {
- if ((self.classname == "player" && self.BUTTON_INFO) || (self.classname != "player")) {
+ if ((IS_PLAYER(self) && self.BUTTON_INFO) || (!IS_PLAYER(self))) {
self.motd_actived_time = time;
Send_CSQC_Centerprint_Generic(self, CPID_MOTD, campaign_message, -1, 0);
}
if (autocvar_g_campaign) {
if (self.BUTTON_INFO)
self.motd_actived_time = time;
- else if ((time - self.motd_actived_time > 2) && self.classname == "player") { // hide it some seconds after BUTTON_INFO has been released
+ else if ((time - self.motd_actived_time > 2) && IS_PLAYER(self)) { // hide it some seconds after BUTTON_INFO has been released
self.motd_actived_time = 0;
Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD);
}
void PlayerUseKey()
{
- if(self.classname != "player")
+ if not(IS_PLAYER(self))
return;
if(self.vehicle)
PrintWelcomeMessage();
- if(self.classname == "player") {
+ if(IS_PLAYER(self)) {
// if(self.netname == "Wazat")
// bprint(self.classname, "\n");
if(g_touchexplode)
if(time > self.touchexplode_time)
- if(self.classname == "player")
+ if(IS_PLAYER(self))
if(self.deadflag == DEAD_NO)
if not(IS_INDEPENDENT_PLAYER(self))
FOR_EACH_PLAYER(other) if(self != other)
if (intermission_running)
IntermissionThink (); // otherwise a button could be missed between
return;
- } else if(self.classname == "observer") {
+ } else if(IS_OBSERVER(self)) {
ObserverThink();
- } else if(self.classname == "spectator") {
+ } else if(IS_SPEC(self)) {
SpectatorThink();
}
float oldspectatee_status;
oldspectatee_status = self.spectatee_status;
- if(self.classname == "spectator")
+ if(IS_SPEC(self))
self.spectatee_status = num_for_edict(self.enemy);
- else if(self.classname == "observer")
+ else if(IS_OBSERVER(self))
self.spectatee_status = num_for_edict(self);
else
self.spectatee_status = 0;
//CheckPlayerJump();
- if(self.classname == "player") {
+ if(IS_PLAYER(self)) {
CheckRules_Player();
UpdateChatBubble();
if (self.impulse)