Advertisement
FlacoBey

Untitled

Jan 30th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.72 KB | None | 0 0
  1. #define ZOMBIECLASS_SMOKER  1
  2. #define ZOMBIECLASS_BOOMER  2
  3. #define ZOMBIECLASS_HUNTER  3
  4. #define ZOMBIECLASS_SPITTER 4
  5. #define ZOMBIECLASS_JOCKEY  5
  6. #define ZOMBIECLASS_CHARGER 6
  7. #define ZOMBIECLASS_WITCH   7
  8. #define ZOMBIECLASS_TANK    8
  9.  
  10. public OnPluginStart()
  11. {
  12.     HookEvent("tank_spawned", TankSpawned);
  13.     AutoExecConfig(true, "RandomHealthBosses");
  14. }
  15.  
  16. public Action:TankSpawned(Handle:event, const String:ename[], bool:dontBroadcast)
  17. {
  18.     int eblan = GetClientOfUserId(GetEventInt(event, "userid"));
  19.     SetEntityHealth(eblan, GetRandomInt(20000, 40000))
  20. }
  21.  
  22. public OnClientPutInServer(client)
  23. {
  24.     CreateTimer(0.5, timer, client, TIMER_FLAG_NO_MAPCHANGE);
  25. }
  26.  
  27. public Action:timer(Handle timer, any client)
  28. {
  29.     if (GetClientTeam(client) == 3)
  30.     {
  31.         new class = GetEntProp(client, Prop_Send, "m_zombieClass");
  32.         if(class == ZOMBIECLASS_SMOKER)
  33.         {
  34.             SetEntityHealth(client, GetRandomInt(50, 9000))
  35.         }
  36.         else if(class == ZOMBIECLASS_BOOMER)
  37.         {
  38.             SetEntityHealth(client, GetRandomInt(60, 90000))
  39.         }
  40.         else if(class == ZOMBIECLASS_HUNTER)
  41.         {
  42.             SetEntityHealth(client, GetRandomInt(80, 2525))
  43.         }
  44.         else if(class == ZOMBIECLASS_SPITTER)
  45.         {
  46.             SetEntityHealth(client, GetRandomInt(9212, 43153))
  47.         }
  48.         else if(class == ZOMBIECLASS_JOCKEY)
  49.         {
  50.             SetEntityHealth(client, GetRandomInt(4126, 5515))
  51.         }
  52.         else if(class == ZOMBIECLASS_CHARGER)
  53.         {
  54.             SetEntityHealth(client, GetRandomInt(1, 999999))
  55.         }
  56.     }
  57. }
  58.  
  59. public IsValidClient(client)
  60. {
  61.     if (client <= 0)
  62.         return false;
  63.        
  64.     if (client > MaxClients)
  65.         return false;
  66.        
  67.     if (!IsClientInGame(client))
  68.         return false;
  69.        
  70.     if (!IsPlayerAlive(client))
  71.         return false;
  72.  
  73.     return true;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement