@@ -61,6 +61,7 @@ char gS_RadioCommands[][] = { "coverme", "takepoint", "holdpos", "regroup", "fol
6161 " getinpos" , " stormfront" , " report" , " roger" , " enemyspot" , " needbackup" , " sectorclear" , " inposition" , " reportingin" ,
6262 " getout" , " negative" , " enemydown" , " compliment" , " thanks" , " cheer" , " go_a" , " go_b" , " sorry" , " needrop" , " playerradio" , " playerchatwheel" , " player_ping" , " chatwheel_ping" };
6363
64+ float gF_LastJointeam [MAXPLAYERS +1 ];
6465bool gB_Hide [MAXPLAYERS +1 ];
6566bool gB_AutoRestart [MAXPLAYERS +1 ];
6667bool gB_Late = false ;
@@ -908,6 +909,17 @@ public Action Command_Jointeam(int client, const char[] command, int args)
908909 iTeam = GetRandomInt (2 , 3 );
909910 }
910911
912+ // Prevent `jointeam` from being too spammable.
913+ if (iTeam != 1 )
914+ {
915+ float now = GetEngineTime ();
916+ if (now - gF_LastJointeam [client ] < 0.35 )
917+ {
918+ return Plugin_Stop ;
919+ }
920+ gF_LastJointeam [client ] = now ;
921+ }
922+
911923 CleanSwitchTeam (client , iTeam );
912924
913925 if (gCV_RespawnOnTeam .BoolValue && iTeam != 1 )
@@ -1497,6 +1509,8 @@ public void OnClientPutInServer(int client)
14971509 return ;
14981510 }
14991511
1512+ gF_LastJointeam [client ] = 0.0 ;
1513+
15001514 if (gEV_Type == Engine_TF2 )
15011515 {
15021516 SDKHook (client , SDKHook_PreThinkPost , TF2_OnPreThink );
0 commit comments