xp,coins loss for humans (camper)

Unpaid Requests, Public Plugins
Post Reply
Templaso
Senior Member
Senior Member
Romania
Posts: 119
Joined: 5 years ago
Location: Bucharest
Contact:

#11

Post by Templaso » 4 years 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

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#12

Post by Raheem » 3 years ago

He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 7 guests