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?
killing zombies addon
-
- Veteran Member
- Posts: 598
- Joined: 7 years ago
- Contact:
-
- Veteran Member
- Posts: 408
- Joined: 5 years ago
- Contact:
yes it's possible, i hope that i can help but i have a school and i can't open the computer too muchczirimbolo 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?
but i will try to help
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))
- }
He who fails to plan is planning to fail
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
Sign in
Who is online
Users browsing this forum: Bing [Bot] and 9 guests