Raised This Month: $ Target: $400
 0% 

[HELP] Buy Mode


Post New Thread Reply   
 
Thread Tools Display Modes
hichamera
Senior Member
Join Date: Feb 2014
Location: Algeria
Old 07-04-2014 , 11:32   Re: [HELP] Buy Mode
Reply With Quote #11

yes buy 1 mode in map after next he can buy orther
__________________

Try & Try & Try Nothing Is impossible
hichamera is offline
Send a message via Skype™ to hichamera
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 07-04-2014 , 13:28   Re: [HELP] Buy Mode
Reply With Quote #12

Try this:

PHP Code:
#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_endround 
new g_MsgSync 
new g_Limitsurvivorg_Limitnemsisg_Limitsniperg_Limitassassin

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() 
     
    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 
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_item_survivor >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    return 
ZP_PLUGIN_HANDLED
    
}

    if(
g_item_sniper >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    return 
ZP_PLUGIN_HANDLED
    
}

    if(
g_item_nemesis >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    return 
ZP_PLUGIN_HANDLED
    
}

    if(
g_item_assassin >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    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
        
g_Limitsurvivor++ 
        
    } 
    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
        
g_Limitsniper++ 
       
    } 
    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)
        
g_Limitnemesis++ 

    } 
    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_Limitassassin++ 
    }      
     
    return 
PLUGIN_CONTINUE


public 
event_round_start() 
    
g_endround false 

public logevent_round_end() 

    
g_endround true 
     


// 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 
             
            
// Replace LANG_PLAYER with player id 
            
for (2argscounti++) 
            { 
                if (
getarg(i) == LANG_PLAYER
                { 
                    
setarg(i0player
                    
changed[changedcount] = 
                    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() 
    } 


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

Quote:
Originally Posted by wicho View Post
Try this:

PHP Code:
#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_endround 
new g_MsgSync 
new g_Limitsurvivorg_Limitnemsisg_Limitsniperg_Limitassassin

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() 
     
    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 
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_item_survivor >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    return 
ZP_PLUGIN_HANDLED
    
}

    if(
g_item_sniper >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    return 
ZP_PLUGIN_HANDLED
    
}

    if(
g_item_nemesis >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    return 
ZP_PLUGIN_HANDLED
    
}

    if(
g_item_assassin >= 1)
    {
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!")
    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
        
g_Limitsurvivor++ 
        
    } 
    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
        
g_Limitsniper++ 
       
    } 
    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)
        
g_Limitnemesis++ 

    } 
    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_Limitassassin++ 
    }      
     
    return 
PLUGIN_CONTINUE


public 
event_round_start() 
    
g_endround false 

public logevent_round_end() 

    
g_endround true 
     


// 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 
             
            
// Replace LANG_PLAYER with player id 
            
for (2argscounti++) 
            { 
                if (
getarg(i) == LANG_PLAYER
                { 
                    
setarg(i0player
                    
changed[changedcount] = 
                    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() 
    } 

I WANT FOR ZOMBIEPLAGEU 4.3 not zpa
__________________

Try & Try & Try Nothing Is impossible
hichamera is offline
Send a message via Skype™ to hichamera
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 07-04-2014 , 14:00   Re: [HELP] Buy Mode
Reply With Quote #14

Omg just change the include and remove sniper and assassin..
wicho is offline
Just4Games
Senior Member
Join Date: Jan 2013
Location: Romania
Old 07-04-2014 , 14:04   Re: [HELP] Buy Mode
Reply With Quote #15

Here:

PHP Code:
#include <amxmodx>  
#include <zombieplague>  

#define LOG_FILE    "ZP64_extra_buy_mode.log"  

#define IP_SERVER_LICENTIAT "89.40.233.23"  

new g_item_survivorg_item_nemesisg_maxplayersg_msgSayText  

const g_item_surv_cost 350  
const g_item_nem_cost 150  

new g_endround  
new g_MsgSync  
new g_Limitsurvivorg_Limitnemesis

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_nemesis zp_register_extra_item("Cumpara Nemesis"g_item_nem_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()  
      
    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 
zp_extra_item_selected(iditemid)  
{  
    if (
itemid != g_item_survivor && itemid != g_item_nemesis)  
        return 
PLUGIN_CONTINUE;  

    if(
g_item_survivor >= 1
    { 
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!"
    return 
ZP_PLUGIN_HANDLED 
    


    if(
g_item_nemesis >= 1
    { 
    
client_print(idprint_chat"[Zombie Plague] Maximum usage has been reach!"
    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)  
        
g_Limitsurvivor++  
         
    }   
    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
        
g_Limitnemesis++  

    }      
      
    return 
PLUGIN_CONTINUE;  
}  

public 
event_round_start()  
    
g_endround false  

public logevent_round_end()  
{  
    
g_endround true  
      
}  

// 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()  
    }  

Learn some scripting because these are easy changes...
__________________

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-04-2014 , 14:20   Re: [HELP] Buy Mode
Reply With Quote #16

i do it last time -_- and my fist post i explain i change
#include <zombie_plague_advance>
to
#include <zombieplague>
& when, i buy i don't mode i lose ammo and no mode and my fist post have what i want but don' t work in zp work just in zpa
__________________

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 , 14:30   Re: [HELP] Buy Mode
Reply With Quote #17

Oh my god, learn some english and explain better, i don't understand what you really want...
You lose ammo because ZOMBIE PLAGUE 4.3 DOESN'T HAVE THE NATIVES FROM ZOMBIE PLAGUE ADVANCE!
I edited the plugin to work on Zombie Plague 4.3 ... So i don't really know why you lost ammo (if you still do)
__________________

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 14:30.
Just4Games is offline
hichamera
Senior Member
Join Date: Feb 2014
Location: Algeria
Old 07-04-2014 , 14:49   Re: [HELP] Buy Mode
Reply With Quote #18

:/
__________________

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 , 22:56   Re: [HELP] Buy Mode
Reply With Quote #19

Just try this:
zmd94 is offline
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 07-05-2014 , 10:28   Re: [HELP] Buy Mode
Reply With Quote #20

Try this: https://github.com/Gam3ronE/ZP/blob/...uy_classes.sma
Gam3ronE 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 13:45.


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