Available Xp and coin reducer for campers

Unpaid Requests, Public Plugins
Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

Xp and coin reducer for campers

#1

Post by Rain1153 » 5 years ago

So my idea is that can we make humans who did not escape( means they died due to the blast/slay/fall etc.) to get thier xp and coins reduced( set by cvars) ?? and there should be a client print chat that his coins and xp are reduced or subtracted!
LOL

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#2

Post by Night Fury » 5 years ago

Try:
  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) || is_user_alive(id))
  20.                 continue
  21.  
  22.             ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(g_pCvarECoins))
  23.             ze_set_user_xp(id, ze_get_user_xp(id) - get_pcvar_num(g_pCvarXP))
  24.             ze_colored_print(id, "You lost %i XP & %i EC", get_pcvar_num(g_pCvarXP), get_pcvar_num(g_pCvarECoins))
  25.         }
  26.     }
  27. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#3

Post by Rain1153 » 5 years ago

can u set the minimum coins to zero becz some gets -values(negative values)
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#4

Post by Rain1153 » 5 years ago

and of course make this plugin ineffective for dead person( zm / human) or specs
LOL

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#5

Post by Night Fury » 5 years ago

Rain1153 wrote: 5 years ago can u set the minimum coins to zero becz some gets -values(negative values)
Rain1153 wrote: 5 years ago and of course make this plugin ineffective for dead person( zm / human) or specs
  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) || (is_user_alive(id) && !ze_is_user_zombie(id)) || get_member(id, m_iTeam) == TEAM_SPECTATOR)
  20.                 continue
  21.  
  22.             if (ze_get_escape_coins(id) - get_pcvar_num(g_pCvarECoins) > 0)
  23.             {
  24.                 ze_set_escape_coins(id, ze_get_escape_coins(id) - get_pcvar_num(g_pCvarECoins))
  25.                 ze_colored_print(id, "You lost %i EC. :P", get_pcvar_num(g_pCvarECoins))
  26.             }
  27.             if (ze_get_user_xp(id) - get_pcvar_num(g_pCvarXP) > 0)
  28.             {
  29.                 ze_set_user_xp(id, ze_get_user_xp(id) - get_pcvar_num(g_pCvarXP))
  30.                 ze_colored_print(id, "You lost %i XP. :P", get_pcvar_num(g_pCvarXP))
  31.             }
  32.         }
  33.     }
  34. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#6

Post by Rain1153 » 5 years ago

error :P
LOL

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#7

Post by Night Fury » 5 years ago

Rain1153 wrote: 5 years agoerror :P
Check.
Next time, provide the error you have faced.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#8

Post by Rain1153 » 5 years ago

if people connect in the middle of the round which means they are dead in either team...they also lose xp and coins :/ any fixes?
LOL

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#9

Post by czirimbolo » 5 years ago

Yes I have the same situation. Can you fix this?
Image

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#10

Post by Night Fury » 5 years ago

czirimbolo wrote: 5 years ago Yes I have the same situation. Can you fix this?
Rain1153 wrote: 5 years ago if people connect in the middle of the round which means they are dead in either team...they also lose xp and coins :/ any fixes?
  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))
  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. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#11

Post by Rain1153 » 5 years ago

now nobody loses thier coins or xp -_-
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#12

Post by Rain1153 » 5 years ago

u can put something like if (!ze_is_user_zombie(id) && trigger hurt something like that?[the map explosion i mean])
LOL

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#13

Post by Night Fury » 5 years ago

Rain1153 wrote: 5 years ago now nobody loses thier coins or xp -_-
viewtopic.php?p=8110#p8110
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#14

Post by czirimbolo » 5 years ago

When I am Spectator, I lose xp and coins too, can you change it ?
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#15

Post by czirimbolo » 5 years ago

Raheem, Jack? Can you fix this?
Image

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

#16

Post by Raheem » 5 years ago

  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. }
He who fails to plan is planning to fail

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#17

Post by Night Fury » 5 years ago

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.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#18

Post by czirimbolo » 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!
Image

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#19

Post by Mark » 5 years ago

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.

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#20

Post by czirimbolo » 5 years ago

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))
                }
            }
        }
    }
}
Image

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 8 guests