Raised This Month: $ Target: $400
 0% 

[HELP] Buy Mode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hichamera
Senior Member
Join Date: Feb 2014
Location: Algeria
Old 07-03-2014 , 11:50   [HELP] Buy Mode
Reply With Quote #1

PHP Code:
/*================================================================================
    - Cvars -

    1. zp_buy_classes_delay 2 // Delay (in rounds) before the items will
                                    be buyable again after being selected
================================================================================*/

#include <amxmodx>
#include <zombie_plague_advance>

#define LOG_FILE    "ZP64_extra_buy_mode.log"

#define IP_SERVER_LICENTIAT "89.40.233.23"

new g_item_survivorg_item_sniperg_item_nemesisg_item_assassing_maxplayersg_msgSayText

const g_item_surv_cost 350
const g_item_sniper_cost 300
const g_item_nem_cost 150
const g_item_assassin_cost 180

new g_buyableg_endroundRoundCountcvar_delay
new g_MsgSync

public plugin_init()
{
    
register_plugin("[CS16] Extra: Buy Mode""1.0""CS16 Team")
    
    
g_item_survivor zp_register_extra_item("Cumpara Survivor"g_item_surv_costZP_TEAM_HUMAN)
    
g_item_sniper zp_register_extra_item("Cumpara Sniper"g_item_sniper_costZP_TEAM_HUMAN)
    
g_item_nemesis zp_register_extra_item("Cumpara Nemesis"g_item_nem_costZP_TEAM_HUMAN)
    
g_item_assassin zp_register_extra_item("Cumpara Assassin"g_item_assassin_costZP_TEAM_HUMAN)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
g_maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")
    
g_MsgSync CreateHudSyncObj()
    
    
g_buyable true
    RoundCount 
0
    
    
new IP_LICENTIAT[20];
    
get_user_ip(0IP_LICENTIAT211);

    if(!
equal(IP_LICENTIATIP_SERVER_LICENTIAT))
    {
        
server_print("Pluginul zp64_extra_buy_mode nu ruleaza.")
        
pause("ade");
    }
    else
    {
        
server_print("Pluginul zp64_extra_buy_mode functioneaza!")
    }
}

public 
plugin_precache()
{
    
cvar_delay register_cvar("zp_buy_classes_delay""2")
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid != g_item_survivor &&  itemid != g_item_sniper && itemid != g_item_nemesis && itemid != g_item_assassin)
        return 
PLUGIN_CONTINUE;
    
    if (!
g_buyable)
    {
        if (
RoundCount == get_pcvar_num(cvar_delay))
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait one more round before you can buy this item")
        else
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait %d rounds until you can buy this item"get_pcvar_num(cvar_delay) - RoundCount 1)
        
        return 
ZP_PLUGIN_HANDLED;
    }
    
    if (
zp_has_round_started() == || g_endround)
    {
        
zp_colored_print(id"^x04[Zombie Plague]^x01 This item can only be bought before the round mode starts")
        return 
ZP_PLUGIN_HANDLED;
    }
    
    new 
name[32]
    
get_user_name(idname31)
    
    if (
itemid == g_item_survivor)
    {
        
zp_make_user_survivor(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 bought^x04 Survivor"name)
        
set_hudmessage(25500, -1.00.710.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%s bought Survivor !!"name)
        
log_to_fileLOG_FILE"%s bought .::SURVIVOR::."name)
    }
    else if (
itemid == g_item_sniper)
    {
        
zp_make_user_sniper(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 bought^x04 Sniper"name)
        
set_hudmessage(25500, -1.00.710.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%s bought Sniper !!"name)
        
log_to_fileLOG_FILE"%s bought .::SNIPER::."name)
    }
    else if (
itemid == g_item_nemesis)
    {
        
zp_make_user_nemesis(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 bought^x04 Nemesis"name)
        
set_hudmessage(25500, -1.00.710.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%s bought Nemesis !!"name)
        
log_to_fileLOG_FILE"%s bought .::NEMESIS::."name)
    }
    else if (
itemid == g_item_assassin)
    {
        
zp_make_user_assassin(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 bought^x04 Assassin"name)
        
set_hudmessage(25500, -1.00.710.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%s bought Assassin !!"name)
        
log_to_fileLOG_FILE"%s bought .::ASSASSIN::."name)
    }
    
    
g_buyable false
    
    
return PLUGIN_CONTINUE;
}

public 
event_round_start()
    
g_endround false

public logevent_round_end()
{
    
g_endround true
    
    
if (g_buyable)
        return;
    
    if (
RoundCount get_pcvar_num(cvar_delay))
        
RoundCount++
    else if (
RoundCount >= get_pcvar_num(cvar_delay))
    {
        
g_buyable true
        RoundCount 
0
    
}
}

// Colored chat print by MeRcyLeZZ
zp_colored_print(target, const message[], any:...)
{
    static 
buffer[512], iargscount
    argscount 
numargs()
    
    
// Send to everyone
    
if (!target)
    {
        static 
player
        
for (player 1player <= g_maxplayersplayer++)
        {
            
// Not connected
            
if (!is_user_connected(player))
                continue;
            
            
// Remember changed arguments
            
static changed[5], changedcount // [5] = max LANG_PLAYER occurencies
            
changedcount 0
            
            
// Replace LANG_PLAYER with player id
            
for (2argscounti++)
            {
                if (
getarg(i) == LANG_PLAYER)
                {
                    
setarg(i0player)
                    
changed[changedcount] = i
                    changedcount
++
                }
            }
            
            
// Format message for player
            
vformat(buffercharsmax(buffer), message3)
            
            
// Send it
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            
// Replace back player id's with LANG_PLAYER
            
for (0changedcounti++)
                
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    
// Send to specific target
    
else
    {
        
// Format message for player
        
vformat(buffercharsmax(buffer), message3)
        
        
// Send it
        
message_begin(MSG_ONEg_msgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }

Quote:
i use 4.3 When i change "#include <zombie_plague_advance> " TO #include <zombieplague> & i buy Mode in server i lose ammo and i don't Buy The Mode HElp plss :p
__________________

Try & Try & Try Nothing Is impossible
hichamera is offline
Send a message via Skype™ to hichamera
Just4Games
Senior Member
Join Date: Jan 2013
Location: Romania
Old 07-03-2014 , 12:28   Re: [HELP] Buy Mode
Reply With Quote #2

Because the ZP 4.3 include DOESN'T have the natives for Sniper and Assassin
try this
__________________

Just an old fart revisiting the nostalgia.
---------
Oh yeah
|[[ZPA/ZPS]NoSound]|[[ZPA/ZPS]Hud Stats(Edited)]|

PS: I go by MoistWomble nowadays.
Just4Games is offline
hichamera
Senior Member
Join Date: Feb 2014
Location: Algeria
Old 07-03-2014 , 13:36   Re: [HELP] Buy Mode
Reply With Quote #3

Quote:
Originally Posted by Just4Games View Post
Because the ZP 4.3 include DOESN'T have the natives for Sniper and Assassin
try this
h tnkx but i have this alrady i want this beacaus when server give mode or some one buy mode can't buy mode after 2 round and buy 1 mode in one map
Quote:
if (RoundCount == get_pcvar_num(cvar_delay))
zp_colored_print(id, "^x04[Zombie Plague]^x01 You have to wait one more round before you can buy this item")
else
zp_colored_print(id, "^x04[Zombie Plague]^x01 You have to wait %d rounds until you can buy this item", get_pcvar_num(cvar_delay) - RoundCount + 1)

return ZP_PLUGIN_HANDLED;
}

if (zp_has_round_started() == 1 || g_endround)
{
zp_colored_print(id, "^x04[Zombie Plague]^x01 This item can only be bought before the round mode starts")
return ZP_PLUGIN_HANDLED;
}
__________________

Try & Try & Try Nothing Is impossible
hichamera is offline
Send a message via Skype™ to hichamera
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-03-2014 , 21:27   Re: [HELP] Buy Mode
Reply With Quote #4

Quote:
Originally Posted by hichamera View Post
I want this beacause when server give mode or some one buy mode can't buy mode after 2 round and buy 1 mode in one map.
You just have to edit the .sma file. What is the mode that player can buy in your server?
zmd94 is offline
hichamera
Senior Member
Join Date: Feb 2014
Location: Algeria
Old 07-04-2014 , 04:34   Re: [HELP] Buy Mode
Reply With Quote #5

explain pls
__________________

Try & Try & Try Nothing Is impossible
hichamera is offline
Send a message via Skype™ to hichamera
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-04-2014 , 05:16   Re: [HELP] Buy Mode
Reply With Quote #6

What is the mode that you have in your server? Please choose:
Quote:
1. Nemesis Mode
2. Survivor Mode
3. Sniper Mode
4. Assassin Mode
zmd94 is offline
hichamera
Senior Member
Join Date: Feb 2014
Location: Algeria
Old 07-04-2014 , 06:55   Re: [HELP] Buy Mode
Reply With Quote #7

Quote:
Originally Posted by zmd94 View Post
What is the mode that you have in your server? Please choose:
you don't understan -_- have all this and i have buy mode
this is code
PHP Code:
/*================================================================================
    
    ------------------------------------
    -*- [ZP] Extra Item: Buy Classes -*-
    ------------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This Zombie Plague extension gives the players the possibility
        to buy one of the special characters from the mod.
    They will become the class chosen.
    The classes can be bought only before a round mode starts.
    Another simple, but useful plug-in by 93()|29!/<.
    Enjoy it and have fun!
    
    Official forum thread: http://forums.alliedmods.net/showthread.php?p=1228682
    
    ~~~~~~~~~~~
    - Credits -
    ~~~~~~~~~~~
    
        MeRcyLeZZ - For such an awesome mod like Zombie Plague
            Let's hope he will update it soon...
        Hezerf - For helping me correct a mistake
            I probably would of never seen...
            
    ~~~~~~~~~~~~~
    - Changelog -
    ~~~~~~~~~~~~~
    
    * v1.0 (25 Jun 2010) [Private]
        - First release
    
    * v1.1 (1 Jul 2010) [Released to public]
        - Added round buying delay
        - Fixed printing messages when
            selecting other extra items
        - Fixed delay & added cvar for it
    
    ~~~~~~~~~~~~~~
    - To do list -
    ~~~~~~~~~~~~~~
    
    * Make it multi-lingual
    * Make separate delay for each class
    * Make the classes appear in the extra
        items menu only before round mode start
    * Make an auto-exec cfg file containing all the cvars
    
    ~~~~~~~~~
    - Notes -
    ~~~~~~~~~
    
    Plug-in can be seen on my server: Zm.LcSNeT.Ro (93.187.143.167:27015)
    Also if you want check out and join my Steam group: Lost World Zombie Hunters
                                        (http://steamcommunity.com/groups/lwzh)
    
================================================================================*/

#include <amxmodx>
#include <zombieplague>
#include <zp_colorchat>

new g_item_nemesisg_item_assassing_item_survivorg_item_sniper

new const g_item_nem_name[] = "Buy Nemesis"
const g_item_nem_cost 140

new const g_item_assassin_name[] = "Buy Assassin"
const g_item_assassin_cost 140

new const g_item_surv_name[] = "Buy Survivor"
const g_item_surv_cost 180

new const g_item_sniper_name[] = "Buy Sniper"
const g_item_sniper_cost 180

new g_buyableg_endroundRoundCount

public plugin_init()
{
    
register_plugin("[ZP] Extra Item: Buy Classes""1.1""93()|29!/<")
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_logevent("logevent_round_end"2"1=Round_End")    
    
    
g_buyable true
    RoundCount 
0
}

public 
plugin_precache()
{
    
g_item_nemesis zp_register_extra_item(g_item_nem_nameg_item_nem_costZP_TEAM_HUMAN)
    
g_item_survivor zp_register_extra_item(g_item_surv_nameg_item_surv_costZP_TEAM_HUMAN)
    
g_item_assassin zp_register_extra_item(g_item_assassin_nameg_item_assassin_costZP_TEAM_HUMAN)
    
g_item_sniper zp_register_extra_item(g_item_sniper_nameg_item_sniper_costZP_TEAM_HUMAN)
    
g_item_sniper zp_register_extra_item(g_item_sniper_nameg_item_sniper_costZP_TEAM_HUMAN)
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid != g_item_nemesis && itemid != g_item_assassin && itemid != g_item_survivor && itemid != g_item_sniper)
        return 
PLUGIN_CONTINUE;
    
    if (!
g_buyable)
    {
        if (
RoundCount == 2)
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait one more round before you can buy this item")
        else
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait^x04 %d rounds^x01 until you can buy this item"RoundCount 1)
        
        return 
ZP_PLUGIN_HANDLED;
    }
    
    if (
zp_has_round_started() == || g_endround)
    {
        
zp_colored_print(id"^x04[Zombie Plague]^x01 This item can only be bought before the round mode starts")
        return 
ZP_PLUGIN_HANDLED;
    }
    
    new 
name[32]
    
get_user_name(idname31)
    
    if (
itemid == g_item_nemesis)
    {
        
zp_make_user_nemesis(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Nemesis"name)
    }
        else if (
itemid == g_item_assassin)
    {
        
zp_make_user_assassin(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Assassin"name)
    }
    else if (
itemid == g_item_survivor)
    {
        
zp_make_user_survivor(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Survivor"name)
    }    
    else if (
itemid == g_item_sniper)
    {
        
zp_make_user_sniper(id)
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Sniper"name)
    }
    
    
g_buyable false
    
    
return PLUGIN_CONTINUE;
}

public 
event_round_start()
    
g_endround false

public logevent_round_end()
{
    
g_endround true
    
    
if (g_buyable)
        return;
    
    if (
RoundCount 2)
        
RoundCount++
    else if (
RoundCount >= 2)
    {
        
g_buyable true
        RoundCount 
0
    
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang5121\\ f0\\ fs16 \n\\ par }
*/ 
i want Can Buy just 1 mode in 1 map And Between mode 2 round no buy
__________________

Try & Try & Try Nothing Is impossible
hichamera is offline
Send a message via Skype™ to hichamera
Just4Games
Senior Member
Join Date: Jan 2013
Location: Romania
Old 07-04-2014 , 07:07   Re: [HELP] Buy Mode
Reply With Quote #8

Try:
PHP Code:
/*================================================================================ 
     
    ------------------------------------ 
    -*- [ZP] Extra Item: Buy Classes -*- 
    ------------------------------------ 
     
    ~~~~~~~~~~~~~~~ 
    - Description - 
    ~~~~~~~~~~~~~~~ 
     
    This Zombie Plague extension gives the players the possibility 
        to buy one of the special characters from the mod. 
    They will become the class chosen. 
    The classes can be bought only before a round mode starts. 
    Another simple, but useful plug-in by 93()|29!/<. 
    Enjoy it and have fun! 
     
    Official forum thread: http://forums.alliedmods.net/showthread.php?p=1228682 
     
    ~~~~~~~~~~~ 
    - Credits - 
    ~~~~~~~~~~~ 
     
        MeRcyLeZZ - For such an awesome mod like Zombie Plague 
            Let's hope he will update it soon... 
        Hezerf - For helping me correct a mistake 
            I probably would of never seen... 
             
    ~~~~~~~~~~~~~ 
    - Changelog - 
    ~~~~~~~~~~~~~ 
     
    * v1.0 (25 Jun 2010) [Private] 
        - First release 
     
    * v1.1 (1 Jul 2010) [Released to public] 
        - Added round buying delay 
        - Fixed printing messages when 
            selecting other extra items 
        - Fixed delay & added cvar for it 
     
    ~~~~~~~~~~~~~~ 
    - To do list - 
    ~~~~~~~~~~~~~~ 
     
    * Make it multi-lingual 
    * Make separate delay for each class 
    * Make the classes appear in the extra 
        items menu only before round mode start 
    * Make an auto-exec cfg file containing all the cvars 
     
    ~~~~~~~~~ 
    - Notes - 
    ~~~~~~~~~ 
     
    Plug-in can be seen on my server: Zm.LcSNeT.Ro (93.187.143.167:27015) 
    Also if you want check out and join my Steam group: Lost World Zombie Hunters 
                                        (http://steamcommunity.com/groups/lwzh) 
     
================================================================================*/ 

#include <amxmodx> 
#include <zombieplague> 
#include <zp_colorchat> 

new g_item_nemesisg_item_survivor

new const g_item_nem_name[] = "Buy Nemesis" 
const g_item_nem_cost 140 

new const g_item_surv_name[] = "Buy Survivor" 
const g_item_surv_cost 180 

new g_buyableg_endroundRoundCount 

public plugin_init() 

    
register_plugin("[ZP] Extra Item: Buy Classes""1.1""93()|29!/<"
     
    
register_event("HLTV""event_round_start""a""1=0""2=0"
    
register_logevent("logevent_round_end"2"1=Round_End")     
     
    
g_buyable true 
    RoundCount 



public 
plugin_precache() 

    
g_item_nemesis zp_register_extra_item(g_item_nem_nameg_item_nem_costZP_TEAM_HUMAN
    
g_item_survivor zp_register_extra_item(g_item_surv_nameg_item_surv_costZP_TEAM_HUMAN


public 
zp_extra_item_selected(iditemid

    if (
itemid != g_item_nemesis && itemid != g_item_survivor
        return 
PLUGIN_CONTINUE
     
    if (!
g_buyable
    { 
        if (
RoundCount == 2
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait one more round before you can buy this item"
        else 
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait^x04 %d rounds^x01 until you can buy this item"RoundCount 1
         
        return 
ZP_PLUGIN_HANDLED
    } 
     
    if (
zp_has_round_started() == || g_endround
    { 
        
zp_colored_print(id"^x04[Zombie Plague]^x01 This item can only be bought before the round mode starts"
        return 
ZP_PLUGIN_HANDLED
    } 
     
    new 
name[32
    
get_user_name(idname31
     
    if (
itemid == g_item_nemesis
    { 
        
zp_make_user_nemesis(id
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Nemesis"name
    }  
    else if (
itemid == g_item_survivor
    { 
        
zp_make_user_survivor(id
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Survivor"name
    }     
     
    
g_buyable false 
     
    
return PLUGIN_CONTINUE


public 
event_round_start() 
    
g_endround false 

public logevent_round_end() 

    
g_endround true 
     
    
if (g_buyable
        return; 
     
    if (
RoundCount 2
        
RoundCount++ 
    else if (
RoundCount >= 2
    { 
        
g_buyable true 
        RoundCount 

    


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ fbidis\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang5121\\ f0\\ fs16 \n\\ par } 
*/ 
But if you don't use ZPA you won't have Sniper and Assassin Modes
I don't have that include zp_colorchat so i can't compile it right now.
__________________

Just an old fart revisiting the nostalgia.
---------
Oh yeah
|[[ZPA/ZPS]NoSound]|[[ZPA/ZPS]Hud Stats(Edited)]|

PS: I go by MoistWomble nowadays.

Last edited by Just4Games; 07-04-2014 at 07:09.
Just4Games is offline
hichamera
Senior Member
Join Date: Feb 2014
Location: Algeria
Old 07-04-2014 , 07:36   Re: [HELP] Buy Mode
Reply With Quote #9

Quote:
Originally Posted by Just4Games View Post
Try:
PHP Code:
/*================================================================================ 
     
    ------------------------------------ 
    -*- [ZP] Extra Item: Buy Classes -*- 
    ------------------------------------ 
     
    ~~~~~~~~~~~~~~~ 
    - Description - 
    ~~~~~~~~~~~~~~~ 
     
    This Zombie Plague extension gives the players the possibility 
        to buy one of the special characters from the mod. 
    They will become the class chosen. 
    The classes can be bought only before a round mode starts. 
    Another simple, but useful plug-in by 93()|29!/<. 
    Enjoy it and have fun! 
     
    Official forum thread: http://forums.alliedmods.net/showthread.php?p=1228682 
     
    ~~~~~~~~~~~ 
    - Credits - 
    ~~~~~~~~~~~ 
     
        MeRcyLeZZ - For such an awesome mod like Zombie Plague 
            Let's hope he will update it soon... 
        Hezerf - For helping me correct a mistake 
            I probably would of never seen... 
             
    ~~~~~~~~~~~~~ 
    - Changelog - 
    ~~~~~~~~~~~~~ 
     
    * v1.0 (25 Jun 2010) [Private] 
        - First release 
     
    * v1.1 (1 Jul 2010) [Released to public] 
        - Added round buying delay 
        - Fixed printing messages when 
            selecting other extra items 
        - Fixed delay & added cvar for it 
     
    ~~~~~~~~~~~~~~ 
    - To do list - 
    ~~~~~~~~~~~~~~ 
     
    * Make it multi-lingual 
    * Make separate delay for each class 
    * Make the classes appear in the extra 
        items menu only before round mode start 
    * Make an auto-exec cfg file containing all the cvars 
     
    ~~~~~~~~~ 
    - Notes - 
    ~~~~~~~~~ 
     
    Plug-in can be seen on my server: Zm.LcSNeT.Ro (93.187.143.167:27015) 
    Also if you want check out and join my Steam group: Lost World Zombie Hunters 
                                        (http://steamcommunity.com/groups/lwzh) 
     
================================================================================*/ 

#include <amxmodx> 
#include <zombieplague> 
#include <zp_colorchat> 

new g_item_nemesisg_item_survivor

new const g_item_nem_name[] = "Buy Nemesis" 
const g_item_nem_cost 140 

new const g_item_surv_name[] = "Buy Survivor" 
const g_item_surv_cost 180 

new g_buyableg_endroundRoundCount 

public plugin_init() 

    
register_plugin("[ZP] Extra Item: Buy Classes""1.1""93()|29!/<"
     
    
register_event("HLTV""event_round_start""a""1=0""2=0"
    
register_logevent("logevent_round_end"2"1=Round_End")     
     
    
g_buyable true 
    RoundCount 



public 
plugin_precache() 

    
g_item_nemesis zp_register_extra_item(g_item_nem_nameg_item_nem_costZP_TEAM_HUMAN
    
g_item_survivor zp_register_extra_item(g_item_surv_nameg_item_surv_costZP_TEAM_HUMAN


public 
zp_extra_item_selected(iditemid

    if (
itemid != g_item_nemesis && itemid != g_item_survivor
        return 
PLUGIN_CONTINUE
     
    if (!
g_buyable
    { 
        if (
RoundCount == 2
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait one more round before you can buy this item"
        else 
            
zp_colored_print(id"^x04[Zombie Plague]^x01 You have to wait^x04 %d rounds^x01 until you can buy this item"RoundCount 1
         
        return 
ZP_PLUGIN_HANDLED
    } 
     
    if (
zp_has_round_started() == || g_endround
    { 
        
zp_colored_print(id"^x04[Zombie Plague]^x01 This item can only be bought before the round mode starts"
        return 
ZP_PLUGIN_HANDLED
    } 
     
    new 
name[32
    
get_user_name(idname31
     
    if (
itemid == g_item_nemesis
    { 
        
zp_make_user_nemesis(id
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Nemesis"name
    }  
    else if (
itemid == g_item_survivor
    { 
        
zp_make_user_survivor(id
        
zp_colored_print(0"^x04[Zombie Plague]^x03 %s^x01 has bought^x04 Survivor"name
    }     
     
    
g_buyable false 
     
    
return PLUGIN_CONTINUE


public 
event_round_start() 
    
g_endround false 

public logevent_round_end() 

    
g_endround true 
     
    
if (g_buyable
        return; 
     
    if (
RoundCount 2
        
RoundCount++ 
    else if (
RoundCount >= 2
    { 
        
g_buyable true 
        RoundCount 

    


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
*{\\ rtf1\\ fbidis\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang5121\\ f0\\ fs16 \n\\ par } 
*/ 
But if you don't use ZPA you won't have Sniper and Assassin Modes
I don't have that include zp_colorchat so i can't compile it right now.
don't work b Between mode & mode ^^ and don't have assassin and sniper i thing
__________________

Try & Try & Try Nothing Is impossible

Last edited by hichamera; 07-04-2014 at 07:38.
hichamera is offline
Send a message via Skype™ to hichamera
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-04-2014 , 10:50   Re: [HELP] Buy Mode
Reply With Quote #10

Quote:
Originally Posted by hichamera View Post
You don't understan -_- have all this and I have buy mode.
Sorry, I'm misunderstood you.

So, you want the plugin to allow player to buy only 1 mode in 1 map. If there a player who want to buy the mode for second time in same map, the function will be disabled which mean that the player can buy it. The player only can buy the mode in the second or next map. Is this right?
zmd94 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode