Page 1 of 1
killing zombies addon
Posted: 16 Nov 2019, 10:44
by czirimbolo
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?
Re: killing zombies addon
Posted: 17 Nov 2019, 05:49
by Muhammet20
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
Re: killing zombies addon
Posted: 14 Oct 2020, 04:02
by Raheem
CVARs as following:
- 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.
- ze_zombie_kill_coins_loss 500 - Coins loss
- ze_zombie_kill_xp_loss 1000 - XP loss
#include <zombie_escape>
#include <ze_levels>
// CVARs
new g_pCvarPlayers,
g_pCvarKillCoins,
g_pCvarKillXP
public plugin_init()
{
register_plugin("[ZE] Zombie Killing Punishment", "1.0", "Raheem")
// Register Player Killed Event
RegisterHookChain(RG_CBasePlayer_Killed, "Fw_PlayerKilled_Post", 1)
// Cvars
g_pCvarPlayers = register_cvar("ze_zombie_kill_punish_players", "3")
g_pCvarKillCoins = register_cvar("ze_zombie_kill_coins_loss", "500")
g_pCvarKillXP = register_cvar("ze_zombie_kill_xp_loss", "1000")
}
public Fw_PlayerKilled_Post(id)
{
// Player killed not human
if (!ze_is_user_zombie(id))
return
new iConnectedHumans, iConnectedZombies
iConnectedHumans = GetTeamPlayersNum(CsTeams:TEAM_CT)
iConnectedZombies = GetTeamPlayersNum(CsTeams:TEAM_TERRORIST)
// Players number high, no punishment
if ((iConnectedHumans+iConnectedZombies) > get_pcvar_num(g_pCvarPlayers))
return
// Punish Zombie
ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(g_pCvarKillCoins))
ze_set_user_xp(id, ze_get_user_xp(id) - get_pcvar_num(g_pCvarKillXP))
ze_colored_print(id, "!tYou lost %i Coins, %i XP for abusing killing!", get_pcvar_num(g_pCvarKillCoins), get_pcvar_num(g_pCvarKillXP))
}