xp,coins loss for humans (camper)

Unpaid Requests, Public Plugins
Mystic Viper
Senior Member
Senior Member
Romania
Posts: 115
Joined: 2 Years Ago
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: xp,coins loss for humans (camper)

#11

Post by Mystic Viper » 7 Months Ago

  1. #include <zombie_escape>
  2.  
  3. #define COINS 50
  4. #define XP 50
  5. #define KILLED_FROM 5 // Time that anyone killed during will be punished
  6.  
  7. new g_iKilledTime[33]
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin("Campers Punishment", "1.0", "Raheem")
  12.    
  13.     RegisterHookChain(RG_CBasePlayer_Killed, "Fw_PlayerKilled_Post", 1)
  14. }
  15.  
  16. public ze_user_humanized(id)
  17. {
  18.     g_iKilledTime[id] = 0;
  19. }
  20.  
  21. public ze_roundend(WinTeam)
  22. {
  23.     if (WinTeam == ZE_TEAM_HUMAN)
  24.     {
  25.         for(new id = 1; id <= MAX_PLAYERS; id++)
  26.         {
  27.             if (!ze_is_user_zombie(id) && !is_user_alive(id))
  28.             {
  29.                 if ((floatround(get_gametime() - g_iKilledTime[id])) <= KILLED_FROM)
  30.                 {
  31.                     ze_set_escape_coins(id, ze_get_escape_coins(id) - COINS)
  32.                     ze_set_user_xp(id, ze_get_user_xp(id) - XP)
  33.                 }
  34.             }
  35.         }
  36.     }
  37. }
  38.  
  39. public Fw_PlayerKilled_Post(id)
  40. {
  41.     g_iKilledTime[id] = floatround(get_gametime())
  42. }

Try this
These users thanked the author Mystic Viper for the post:
Raheem (6 Days Ago)


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest