Advertisement
FlacoBey

Untitled

Feb 15th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. int heal[MAXPLAYERS+1] = 100;
  2.  
  3. public OnMapStart()
  4. {
  5.     HookEvent("map_transition", hTransition)
  6.     CreateTimer(5.0, SetHealth, _, TIMER_FLAG_NO_MAPCHANGE)
  7. }
  8.  
  9. public Action:hTransition(Handle:event, const String:s_Name[], bool:b_DontBroadcast)
  10. {
  11.     for(int i = 1; i <= MaxClients; ++i)
  12.     {
  13.         new Health = GetClientHealth(i)
  14.         heal[i] = Health;
  15.     }
  16. }
  17.  
  18. public Action SetHealth(Handle timer, any fuck)
  19. {
  20.     for(int i = 1; i <= MaxClients; ++i)
  21.     {
  22.         if(bIsSurvivor(i))
  23.         {
  24.             SetEntityHealth(heal[i], i);
  25.         }
  26.     }
  27. }
  28.  
  29. stock bool bIsSurvivor(int client)
  30. {
  31.     return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement