Available killing zombies addon

Unpaid Requests, Public Plugins
Post Reply
czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

killing zombies addon

#1

Post by czirimbolo » 4 years ago

Hello, I want to punish zombies who camp on respawn and can be killed by his friend (human). Human earns exp and coins thanks to this so its common on my server. Especially at night when there are 2-3 players. I would like to make something like this:

When human kills zombie:
- human get coins and xp like always
- zombies loses coins and xp for being killed

Example:

Zombie loses 500 coins and 1000 xp for being killed.

Raheem, can we make something like this?
Image

Muhammet20
Veteran Member
Veteran Member
Posts: 408
Joined: 5 years ago
Contact:

#2

Post by Muhammet20 » 4 years ago

czirimbolo wrote: 4 years ago Hello, I want to punish zombies who camp on respawn and can be killed by his friend (human). Human earns exp and coins thanks to this so its common on my server. Especially at night when there are 2-3 players. I would like to make something like this:

When human kills zombie:
- human get coins and xp like always
- zombies loses coins and xp for being killed

Example:

Zombie loses 500 coins and 1000 xp for being killed.

Raheem, can we make something like this?
yes it's possible, i hope that i can help but i have a school and i can't open the computer too much
but i will try to help

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

#3

Post by Raheem » 3 years ago

CVARs as following:
  1. ze_zombie_kill_punish_players 3 - This check based on the summation of all connected players in zombie and humans teams. If the summation lower than this CVAR value then the punishment will be ON. If players count higher than this CVAR value then punishment is OFF.
  2. ze_zombie_kill_coins_loss 500 - Coins loss
  3. ze_zombie_kill_xp_loss 1000 - XP loss
  1. #include <zombie_escape>
  2. #include <ze_levels>
  3.  
  4. // CVARs
  5. new g_pCvarPlayers,
  6.     g_pCvarKillCoins,
  7.     g_pCvarKillXP
  8.  
  9. public plugin_init()
  10. {
  11.     register_plugin("[ZE] Zombie Killing Punishment", "1.0", "Raheem")
  12.    
  13.     // Register Player Killed Event
  14.     RegisterHookChain(RG_CBasePlayer_Killed, "Fw_PlayerKilled_Post", 1)
  15.    
  16.     // Cvars
  17.     g_pCvarPlayers = register_cvar("ze_zombie_kill_punish_players", "3")
  18.     g_pCvarKillCoins = register_cvar("ze_zombie_kill_coins_loss", "500")
  19.     g_pCvarKillXP = register_cvar("ze_zombie_kill_xp_loss", "1000")
  20. }
  21.  
  22. public Fw_PlayerKilled_Post(id)
  23. {
  24.     // Player killed not human
  25.     if (!ze_is_user_zombie(id))
  26.         return
  27.    
  28.     new iConnectedHumans, iConnectedZombies
  29.     iConnectedHumans = GetTeamPlayersNum(CsTeams:TEAM_CT)
  30.     iConnectedZombies = GetTeamPlayersNum(CsTeams:TEAM_TERRORIST)
  31.    
  32.     // Players number high, no punishment
  33.     if ((iConnectedHumans+iConnectedZombies) > get_pcvar_num(g_pCvarPlayers))
  34.         return
  35.    
  36.     // Punish Zombie
  37.     ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(g_pCvarKillCoins))
  38.     ze_set_user_xp(id, ze_get_user_xp(id) - get_pcvar_num(g_pCvarKillXP))
  39.    
  40.     ze_colored_print(id, "!tYou lost %i Coins, %i XP for abusing killing!", get_pcvar_num(g_pCvarKillCoins), get_pcvar_num(g_pCvarKillXP))
  41. }
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: Bing [Bot] and 9 guests