Page 1 of 2

Re: Xp and coin reducer for campers

Posted: 09 Sep 2018, 08:32
by Rain1153
now nobody loses thier coins or xp -_-

Re: Xp and coin reducer for campers

Posted: 09 Sep 2018, 08:34
by Rain1153
u can put something like if (!ze_is_user_zombie(id) && trigger hurt something like that?[the map explosion i mean])

Re: Xp and coin reducer for campers

Posted: 09 Sep 2018, 15:36
by Night Fury
Rain1153 wrote: 5 years ago now nobody loses thier coins or xp -_-
viewtopic.php?p=8110#p8110

Re: Xp and coin reducer for campers

Posted: 09 Sep 2018, 17:46
by czirimbolo
When I am Spectator, I lose xp and coins too, can you change it ?

Re: Xp and coin reducer for campers

Posted: 15 Sep 2018, 19:33
by czirimbolo
Raheem, Jack? Can you fix this?

Re: Xp and coin reducer for campers

Posted: 15 Sep 2018, 20:00
by Raheem
  1. #include <zombie_escape>
  2. #include <ze_levels>
  3.  
  4. new g_pCvarXP, g_pCvarECoins
  5.  
  6. public plugin_init()
  7. {
  8.     register_plugin("[ZE] Addons: Reduce on fail escape", "1.0", "Jack GamePlay")
  9.     g_pCvarECoins = register_cvar("ze_escapecoins", "1")
  10.     g_pCvarXP = register_cvar("ze_xp", "1")
  11. }
  12.  
  13. public ze_roundend(Winner)
  14. {
  15.     if (Winner == ZE_TEAM_HUMAN)
  16.     {
  17.         for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
  18.         {
  19.             if (ze_is_user_zombie(id) || get_member(id, m_iTeam) == TEAM_SPECTATOR)
  20.                 continue
  21.  
  22.             if (!ze_is_user_zombie(id) && !is_user_alive(id))
  23.             {
  24.                 if (ze_get_escape_coins(id) - get_pcvar_num(g_pCvarECoins) <= 0)
  25.                 {
  26.                     ze_set_escape_coins(id, 0)
  27.                     ze_colored_print(id, "You lost your EC.")
  28.                 }
  29.                 else
  30.                 {
  31.                     ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(g_pCvarECoins))
  32.                     ze_colored_print(id, "You lost %i EC. :P", get_pcvar_num(g_pCvarECoins))
  33.                 }
  34.  
  35.                 if (ze_get_user_xp(id) - get_pcvar_num(g_pCvarXP) <= 0)
  36.                 {
  37.                     ze_set_user_xp(id, 0)
  38.                     ze_colored_print(id, "You lost your XP. :P")
  39.                 }
  40.                 else
  41.                 {
  42.                     ze_set_user_xp(id, ze_get_user_xp(id) - get_pcvar_num(g_pCvarXP))
  43.                     ze_colored_print(id, "You lost %i XP. :P", get_pcvar_num(g_pCvarXP))
  44.                 }
  45.             }
  46.         }
  47.     }
  48. }

Re: Xp and coin reducer for campers

Posted: 15 Sep 2018, 20:28
by Night Fury
czirimbolo wrote: 5 years ago When I am Spectator, I lose xp and coins too, can you change it ?
I rewrote the code. Only forgot to bump.
6 days ago.

Re: Xp and coin reducer for campers

Posted: 11 Oct 2018, 15:21
by czirimbolo
Still doesnt work properly, I lose xp and cois when I join game. Can you fix and test it? We need these for campers!

Re: Xp and coin reducer for campers

Posted: 11 Oct 2018, 16:05
by Mark
czirimbolo wrote: 5 years ago Still doesnt work properly, I lose xp and cois when I join game. Can you fix and test it? We need these for campers!
Post the current code your using here so we may see it.

Re: Xp and coin reducer for campers

Posted: 11 Oct 2018, 18:35
by czirimbolo

Code: Select all

#include <zombie_escape>
#include <ze_levels>
 
new g_pCvarXP, g_pCvarECoins
 
public plugin_init()
{
    register_plugin("[ZE] Addons: Reduce on fail escape", "1.0", "Jack GamePlay")
    g_pCvarECoins = register_cvar("ze_escapecoins", "1")
    g_pCvarXP = register_cvar("ze_xp", "1")
}
 
public ze_roundend(Winner)
{
    if (Winner == ZE_TEAM_HUMAN)
    {
        for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
        {
            if (ze_is_user_zombie(id) || is_user_alive(id) || get_member(id, m_iTeam) != TEAM_SPECTATOR)
                continue
 
            if (ze_is_user_zombie(id) && is_user_alive(id))
            {
                if (ze_get_escape_coins(id) - get_pcvar_num(g_pCvarECoins) <= 0)
                {
                    ze_set_escape_coins(id, 0)
                    ze_colored_print(id, "You lost your EC.")
                }
                else
                {
                    ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(g_pCvarECoins))
                    ze_colored_print(id, "You lost %i EC. :P", get_pcvar_num(g_pCvarECoins))
                }
 
                if (ze_get_user_xp(id) - get_pcvar_num(g_pCvarXP) <= 0)
                {
                    ze_set_user_xp(id, 0)
                    ze_colored_print(id, "You lost your XP. :P")
                }
                else
                {
                    ze_set_user_xp(id, ze_get_user_xp(id) - get_pcvar_num(g_pCvarXP))
                    ze_colored_print(id, "You lost %i XP. :P", get_pcvar_num(g_pCvarXP))
                }
            }
        }
    }
}

Re: Xp and coin reducer for campers

Posted: 14 May 2019, 16:45
by Spir0x
Ok, where's the working code ? or this plugin still under test.

Re: Xp and coin reducer for campers

Posted: 14 May 2019, 19:55
by czirimbolo
its not working Spirox