Advertisement
FlacoBey

Untitled

Jan 30th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. public OnPluginStart()
  2. {
  3.     HookEvent("tank_spawn", TankSpawned);
  4. }
  5.  
  6. public Action:TankSpawned(Handle:event, const String:ename[], bool:dontBroadcast)
  7. {
  8.  
  9.     int eblan = GetClientOfUserId(GetEventInt(event, "userid"));
  10.     if(IsValidInfected(eblan))
  11.     {
  12.         CreateTimer(0.5, timer, eblan, TIMER_FLAG_NO_MAPCHANGE);
  13.     }
  14. }
  15.  
  16. public Action:timer(Handle timer, any client)
  17. {
  18.     if(IsValidInfected(client))
  19.     {
  20.         SetEntityHealth(client, GetRandomInt(1, 950000));
  21.     }
  22. }
  23.  
  24. stock bool:IsValidInfected( client )
  25. {
  26.     if ( client < 1 || client > MaxClients ) return false;
  27.     if ( !IsClientConnected( client )) return false;
  28.     if ( !IsClientInGame( client )) return false;
  29.     if ( GetClientTeam( client ) != 3 ) return false;
  30.     return true;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement