//========================================================================= // Make the spy who owns this timer undercover, and then remove itself void TeamFortress_SpyUndercoverThink( ) { gedict_t *owner = PROG_TO_EDICT( self->s.v.owner ); if ( owner->playerclass != PC_SPY ) return; if ( owner->is_undercover == 2 ) { if ( tf_data.invis_only == 1 ) { owner->s.v.items = ( int ) owner->s.v.items | IT_INVISIBILITY; owner->s.v.frame = 0; owner->s.v.modelindex = modelindex_eyes; owner->is_undercover = 1; } else { owner->immune_to_check = g_globalvars.time + tf_data.cheat_pause; //10; if ( self->s.v.skin ) { owner->undercover_skin = self->s.v.skin; TeamFortress_SetSkin( owner ); G_sprint( owner, 2, "Skin set to " ); TeamFortress_PrintClassName( owner, self->s.v.skin, 0 ); } if ( self->s.v.team ) { owner->undercover_team = self->s.v.team; TeamFortress_SetColor( owner, TeamFortress_TeamGetTopColor( self->s.v.team ), TeamFortress_TeamGetColor( self->s.v.team ) - 1 ); TeamFortress_SetSkin( owner ); G_sprint( owner, 2, "Colors set to Team %.0f\n", self->s.v.team ); } TeamFortress_SpyCalcName( owner ); if ( !owner->StatusBarSize ) G_centerprint( owner, "You are now disguised.\n" ); owner->is_undercover = 1; } } owner->StatusRefreshTime = g_globalvars.time + 0.1; dremove( self ); }
void TeamFortress_MOTD( ) { if ( self->motd == 4 ) stuffcmd( self, "is_aliased\n" ); if ( self->motd <= 20 ) { self->motd += 1; return; } if ( self->motd == 21 ) { if ( !0 ) self->tfstate |= TFSTATE_ZOOMOFF; if ( teamplay && !self->team_no ) { TeamFortress_SetColor( self, 0,0); } if ( !self->got_aliases ) G_sprint( self, 2, "\n\n\n" ); G_sprint( self, 2, "Type help for more info.\n" ); G_sprint( self, 2, "ΡυαλεΧοςμδ ΤεανΖοςτςεσσ \n" ); if( tf_data.enable_bot ) { G_sprint( self, 2, "Bots Enabled\n" ); } // G_sprint(self, 2, "Official ΝΤΖΜ version\n"); G_sprint( self, 2, "by sd angel for ΝΤΖΜ\n" ); G_sprint( self, 2, "Bug reports to [email protected]\n" ); G_sprint( self, 2, "http://ντζμ�σδ�ςυ\n" ); self->menu_displaytime = 0; self->current_menu = MENU_INTRO; self->menu_count = MENU_REFRESH_RATE; self->motd = 22; if ( self->got_aliases == 1 ) return; G_sprint( self, 2, "binding aliases...\n" ); TeamFortress_Alias( "inv", 135, 0 ); TeamFortress_Alias( "showtf", 136, 0 ); TeamFortress_Alias( "autozoom", 174, 0 ); TeamFortress_Alias( "changeclass", 99, 0 ); TeamFortress_Alias( "scout", TF_CHANGEPC + PC_SCOUT, 0 ); TeamFortress_Alias( "sniper", TF_CHANGEPC + PC_SNIPER, 0 ); TeamFortress_Alias( "soldier", TF_CHANGEPC + PC_SOLDIER, 0 ); TeamFortress_Alias( "demoman", TF_CHANGEPC + PC_DEMOMAN, 0 ); TeamFortress_Alias( "medic", TF_CHANGEPC + PC_MEDIC, 0 ); TeamFortress_Alias( "hwguy", TF_CHANGEPC + PC_HVYWEAP, 0 ); TeamFortress_Alias( "pyro", TF_CHANGEPC + PC_PYRO, 0 ); TeamFortress_Alias( "spy", TF_CHANGEPC + PC_SPY, 0 ); TeamFortress_Alias( "engineer", TF_CHANGEPC + PC_ENGINEER, 0 ); TeamFortress_Alias( "randompc", TF_CHANGEPC + PC_RANDOM, 0 ); TeamFortress_Alias( "is_aliased", 13, 0 ); return; } if ( self->motd <= 95 ) self->motd += 1; if ( self->motd == 25 ) { TeamFortress_Alias( "detpipe", 170, 0 ); TeamFortress_Alias( "reload", 173, 0 ); TeamFortress_Alias( "scan10", 162, 0 ); TeamFortress_Alias( "scan30", 163, 0 ); TeamFortress_Alias( "scan50", 164, 0 ); TeamFortress_Alias( "scan100", 164, 0 ); TeamFortress_Alias( "scanf", 161, 0 ); TeamFortress_Alias( "scane", 160, 0 ); TeamFortress_Alias( "autoscan", AUTOSCAN_IMPULSE, 0 ); TeamFortress_Alias("scanf_off", TF_SCAN, TF_POST_SCANF_OFF); TeamFortress_Alias("scanf_on" , TF_SCAN, TF_POST_SCANF_ON ); TeamFortress_Alias("scane_off", TF_SCAN, TF_POST_SCANE_OFF); TeamFortress_Alias("scane_on" , TF_SCAN, TF_POST_SCANE_ON ); TeamFortress_Alias("autoscan_on" , TF_SCAN, TF_POST_AUTOSCAN_ON ); TeamFortress_Alias("autoscan_off" , TF_SCAN, TF_POST_AUTOSCAN_OFF ); return; } if ( self->motd == 35 ) { TeamFortress_Alias( "primeone", 150, 0 ); TeamFortress_Alias( "primetwo", 151, 0 ); TeamFortress_Alias( "throwgren", 152, 0 ); TeamFortress_Alias( "+gren1", 150, 0 ); TeamFortress_Alias( "+gren2", 151, 0 ); TeamFortress_Alias( "-gren1", 152, 0 ); TeamFortress_Alias( "-gren2", 152, 0 ); TeamFortress_Alias( "showscores", 145, 0 ); TeamFortress_Alias( "showclasses", 144, 0 ); TeamFortress_Alias( "query", 119, 0 ); return; } if ( self->motd == 45 ) { TeamFortress_Alias( "dropkey", 175, 0 ); TeamFortress_Alias( "dropammo", 172, 0 ); TeamFortress_Alias( "dropitems", 194, 0 ); TeamFortress_Alias( "showloc", 118, 0 ); TeamFortress_Alias( "special", 171, 0 ); TeamFortress_Alias( "saveme", 181, 0 ); TeamFortress_Alias( "discard", 184, 0 ); TeamFortress_Alias( "id", 185, 0 ); return; } if ( self->motd == 55 ) { TeamFortress_Alias( "flaginfo", 23, 0 ); TeamFortress_Alias( "maphelp", 131, 0 ); TeamFortress_Alias( "showids", 186, 0 ); stuffcmd( self, "bind 9 \"impulse 9\"\n" ); stuffcmd( self, "bind 0 \"impulse 10\"\n" ); return; } if ( self->motd == 65 ) { TeamFortress_Alias( "sbar_on", 182, 0 ); TeamFortress_Alias( "sbar_off", 183, 0 ); TeamFortress_Alias( "sbar_200", 71, 0 ); TeamFortress_Alias( "sbar_240", 71 + 1, 0 ); TeamFortress_Alias( "sbar_300", 71 + 2, 0 ); TeamFortress_Alias( "sbar_350", 71 + 3, 0 ); TeamFortress_Alias( "sbar_384", 71 + 4, 0 ); TeamFortress_Alias( "sbar_400", 71 + 5, 0 ); TeamFortress_Alias( "sbar_480", 71 + 6, 0 ); TeamFortress_Alias( "sbar_600", 71 + 7, 0 ); TeamFortress_Alias( "sbar_768", 71 + 8, 0 ); return; } if ( self->motd == 75 ) { TeamFortress_Alias( "+det5", 165, 0 ); TeamFortress_Alias( "-det5", 169, 0 ); TeamFortress_Alias( "+det20", 166, 0 ); TeamFortress_Alias( "-det20", 169, 0 ); TeamFortress_Alias( "+det50", 167, 0 ); TeamFortress_Alias( "-det50", 169, 0 ); return; } if ( self->motd == 85 ) { if(tg_data.tg_enabled) { TeamFortress_Alias( "mod_menu", TG_MAINMENU_IMPULSE, 0 ); TeamFortress_Alias( "sg_rebuild", TG_SG_REBUILD_IMPULSE, 0 ); TeamFortress_Alias( "sg_reload", TG_SG_RELOAD_IMPULSE, 0 ); TeamFortress_Alias( "sg_upgrade", TG_SG_UPGRADE_IMPULSE, 0 ); TeamFortress_Alias( "disp_load", TG_DISP_LOAD_IMPULSE, 0 ); TeamFortress_Alias( "disp_unload", TG_DISP_UNLOAD_IMPULSE, 0 ); TeamFortress_Alias( "eff_conc", TG_CONC_IMPULSE, 0); TeamFortress_Alias( "eff_flash", TG_FLASH_IMPULSE, 0); TeamFortress_Alias( "eff_remove", TG_EFF_REMOVE_IMPULSE, 0); } return; } if ( self->motd == 95 ) { TeamFortress_Alias( "disguise", 177, 0 ); TeamFortress_Alias( "feign", 178, 0 ); TeamFortress_Alias( "sfeign", TF_SPY_SFEIGN_IMPULSE, 0 ); TeamFortress_Alias( "build", 179, 0 ); TeamFortress_Alias( "detsentry", 188, 0 ); TeamFortress_Alias( "detdispenser", 187, 0 ); } }
void TeamFortress_CheckTeamCheats( ) { char st[20]; const char *sk; int tc; if ( self->immune_to_check > g_globalvars.time ) return; if ( self->s.v.deadflag ) return; if ( !( self->s.v.netname[0] ) ) KickCheater( self ); else { if ( self->playerclass && !self->team_no && teamplay > 0 ) KickCheater( self ); } if ( self->team_no > 0 && teamplay > 0 ) { tc = GetInfokeyInt( self, "bottomcolor", NULL, 0 ); if ( self->playerclass == PC_SPY && self->undercover_team ) { if ( TeamFortress_TeamGetColor( self->undercover_team ) - 1 != tc ) { TeamFortress_SetColor( self, TeamFortress_TeamGetTopColor( self->undercover_team ), TeamFortress_TeamGetColor( self->undercover_team ) - 1 ); G_bprint( 1, "%s has been kicked for changing color.\n", self->s.v.netname ); G_sprint( self, 2, "You have been kicked for changing your pants color. Don't do it.\n" ); KickCheater( self ); return; } } else { if ( tc != TeamFortress_TeamGetColor( self->team_no ) - 1 ) { TeamFortress_SetColor( self, TeamFortress_TeamGetTopColor( self->team_no ), TeamFortress_TeamGetColor( self->team_no ) - 1 ); G_bprint( 1, "%s has been kicked for changing color.\n", self->s.v.netname ); G_sprint( self, 2, "You have been kicked for changing your pants color. Don't do it.\n" ); KickCheater( self ); return; } } if ( tf_data.topcolor_check ) { tc = GetInfokeyInt( self, "topcolor", NULL, 0 ); if ( self->playerclass == PC_SPY && self->undercover_team ) { if ( TeamFortress_TeamGetTopColor( self->undercover_team ) != tc ) { TeamFortress_SetColor( self, TeamFortress_TeamGetTopColor( self->undercover_team ), TeamFortress_TeamGetColor( self->undercover_team ) - 1 ); G_bprint( 1, "%s has been kicked for changing color.\n", self->s.v.netname ); G_sprint( self, 2, "You have been kicked for changing your top color. Don't do it.\n" ); KickCheater( self ); return; } } else { if ( tc != TeamFortress_TeamGetTopColor( self->team_no ) ) { TeamFortress_SetColor( self, TeamFortress_TeamGetTopColor( self->undercover_team ), TeamFortress_TeamGetColor( self->undercover_team ) - 1 ); G_bprint( 1, "%s has been kicked for changing color.\n", self->s.v.netname ); G_sprint( self, 2, "You have been kicked for changing your top color. Don't do it.\n" ); KickCheater( self ); return; } } } if ( self->playerclass ) { GetInfokeyString( self, "skin", NULL, st, sizeof( st ), "" ); tc = 0; sk = TeamFortress_GetSkin( self ); if ( strneq( st, sk ) ) { TeamFortress_SetSkin( self ); G_bprint( 1, "%s has been kicked for changing skin.\n", self->s.v.netname ); G_sprint( self, 2, "You have been kicked for changing your skin. Don't do it.\n" ); KickCheater( self ); } if ( tc == 8 ) self->playerclass = 8; } sk = GetTeamName( self->team_no ); GetInfokeyString( self, "team", NULL, st, sizeof( st ), "" ); if ( strneq( st, sk ) ) { SetTeamName( self ); G_bprint( 1, " has been kicked for changing team.\n", self->s.v.netname ); G_sprint( self, 2, "You have been kicked for changing your team. Don't do it.\n" ); KickCheater( self ); return; } } }
int TeamFortress_TeamSet( int tno ) { int tc; if ( teamplay < 1 ) { G_sprint( self, 2, "Teamplay is not On, so FortressTeams are inactive.\n" ); return 0; } if ( tno > number_of_teams && number_of_teams ) { G_sprint( self, 2, "There can be only %d teams on this map.\nTry again\n", number_of_teams ); return 0; } if ( self->team_no > 0 ) { G_sprint( self, 2, "You're already in Team No %d.\n", self->team_no ); return 0; } tc = TeamFortress_TeamGetNoPlayers( tno ); if ( tc >= TeamFortress_TeamGetMaxPlayers( tno ) ) { G_sprint( self, 2, "That team is full. Pick another.\n" ); return 0; } if ( !TeamFortress_TeamGetColor( tno ) ) { //TeamFortress_TeamSetColor( tno ); if ( !TeamFortress_TeamGetColor( tno ) ) { G_sprint( self, 2, "You can't start a new team with your color, since another " ); G_sprint( self, 2, "already using that color. Change your pants color, then try again.\n" ); return 0; } G_bprint( 2, "%s has started Team No %d.\n", self->s.v.netname, tno ); self->immune_to_check = g_globalvars.time + 10; if ( ( tf_data.toggleflags & TFLAG_TEAMFRAGS ) || ( tf_data.toggleflags & TFLAG_FULLTEAMSCORE ) ) self->s.v.frags = TeamFortress_TeamGetScore( tno ); TeamFortress_SetColor( self, TeamFortress_TeamGetTopColor( tno ), TeamFortress_TeamGetColor( tno ) - 1 ); self->team_no = tno; self->lives = TeamFortress_TeamGetLives( tno ); SetTeamName( self ); if ( !self->playerclass ) { if ( TeamFortress_TeamIsCivilian( self->team_no ) ) { self->s.v.impulse = 1; TeamFortress_ChangeClass( ); } } return 1; } G_bprint( 2, "%s has joined Team No %d.\n", self->s.v.netname, tno ); TeamFortress_SetColor( self, TeamFortress_TeamGetTopColor( tno ), TeamFortress_TeamGetColor( tno ) - 1 ); self->team_no = tno; self->immune_to_check = g_globalvars.time + 10; self->lives = TeamFortress_TeamGetLives( tno ); if ( ( tf_data.toggleflags & TFLAG_TEAMFRAGS ) || ( tf_data.toggleflags & TFLAG_FULLTEAMSCORE ) ) self->s.v.frags = TeamFortress_TeamGetScore( tno ); TeamFortress_TeamShowMemberClasses( self ); SetTeamName( self ); if ( !self->playerclass ) { if ( TeamFortress_TeamIsCivilian( self->team_no ) ) { self->s.v.impulse = 1; TeamFortress_ChangeClass( ); } } return 1; }