KnifeMadness: Hopefully fix spec exploit
This commit is contained in:
		
							parent
							
								
									f06fded5f5
								
							
						
					
					
						commit
						ec897c3466
					
				| @ -2,6 +2,7 @@ | ||||
| #include <sdktools> | ||||
| #include <multicolors> | ||||
| #include <zombiereloaded> | ||||
| #include <loghelper> | ||||
| 
 | ||||
| #pragma semicolon 1 | ||||
| #pragma newdecls required | ||||
| @ -35,6 +36,7 @@ public void OnPluginStart() | ||||
| 	HookEvent("player_spawn",   OnClientSpawn,  EventHookMode_Post); | ||||
| 	HookEvent("player_death",   OnClientDeath,  EventHookMode_Pre); | ||||
| 	HookEvent("player_hurt",    OnClientHurt,   EventHookMode_Post); | ||||
| 	HookEvent("player_team", 	OnClientTeam,   EventHookMode_Pre); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| @ -100,6 +102,20 @@ public void OnClientHurt(Event hEvent, const char[] sEvent, bool bDontBroadcast) | ||||
| 	pack.WriteCell(GetClientUserId(victim)); | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| public void OnClientTeam(Event hEvent, const char[] sEvent, bool bDontBroadcast) | ||||
| { | ||||
| 	int client = GetClientOfUserId(hEvent.GetInt("userid")); | ||||
| 
 | ||||
| 	if (g_bClientKnifed[client]) | ||||
| 	{ | ||||
| 		g_bClientKnifed[client] = false; | ||||
| 		LogPlayerEvent(client, "triggered", "switch_to_spec"); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
| // Purpose: | ||||
| //---------------------------------------------------------------------------------------------------- | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user