Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPluginStart()
- {
- HookEvent("tank_spawn", TankSpawned);
- }
- public Action:TankSpawned(Handle:event, const String:ename[], bool:dontBroadcast)
- {
- int eblan = GetClientOfUserId(GetEventInt(event, "userid"));
- if(IsValidInfected(eblan))
- {
- CreateTimer(0.5, timer, eblan, TIMER_FLAG_NO_MAPCHANGE);
- }
- }
- public Action:timer(Handle timer, any client)
- {
- if(IsValidInfected(client))
- {
- SetEntityHealth(client, GetRandomInt(1, 950000));
- }
- }
- stock bool:IsValidInfected( client )
- {
- if ( client < 1 || client > MaxClients ) return false;
- if ( !IsClientConnected( client )) return false;
- if ( !IsClientInGame( client )) return false;
- if ( GetClientTeam( client ) != 3 ) return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement