Raised This Month: $51 Target: $400
 12% 

[REQ] edit zp buy classes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
marijuana666
Junior Member
Join Date: Dec 2010
Location: Romania, Turda
Old 09-01-2013 , 18:09   [REQ] edit zp buy classes
Reply With Quote #1

Hello!
I want a change this plugin:
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...
            
    ~~~~~~~~~
    - Cvars -
    ~~~~~~~~~
    
    1. zp_buy_classes_delay 15 // Delay (in rounds) before the items will
                                    be buyable again after being selected
    
    ~~~~~~~~~~~~~
    - 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 <zombie_plague_advance>

new g_item_nemesisg_item_survivorg_item_assassing_item_sniperg_maxplayersg_msgSayText

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

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

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

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

new g_buyableg_endroundRoundCountcvar_delay

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_maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")
    
    
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)
    
    
cvar_delay register_cvar("zp_buy_classes_delay""2")
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid != g_item_nemesis && itemid != g_item_survivor && itemid != g_item_sniper)
        return 
PLUGIN_CONTINUE;
    
    if (!
g_buyable)
    {
        if (
RoundCount == get_pcvar_num(cvar_delay))
            
zp_colored_print(id"^x04[ZP]^x01 You have to wait one more round before you can buy this item")
        else
            
zp_colored_print(id"^x04[ZP]^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[ZP]^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[ZP]^x03 %s^x01 has bought^x04 Nemesis"name)
    }
    else if (
itemid == g_item_survivor)
    {
        
zp_make_user_survivor(id)
        
zp_colored_print(0"^x04[ZP]^x03 %s^x01 has bought^x04 Survivor"name)
    }
    else if (
itemid == g_item_assassin)
    {
        
zp_make_user_assassin(id)
        
zp_colored_print(0"^x04[ZP]^x03 %s^x01 has bought^x04 Assassin"name)
    }
    else if (
itemid == g_item_sniper)
    {
        
zp_make_user_sniper(id)
        
zp_colored_print(0"^x04[ZP]^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 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()
    }

EDIT:
Any player can buy 1 mode per map

Sorry for my bad english! Please help

Last edited by marijuana666; 09-03-2013 at 13:36.
marijuana666 is offline
ANZ@R
Member
Join Date: Jun 2013
Old 09-03-2013 , 12:41   Re: [REQ] edit zp buy classes
Reply With Quote #2

Dont understand!
Improve ur english...
ANZ@R is offline
Cigojlo
Senior Member
Join Date: May 2013
Location: Serbia / Belgrade
Old 09-03-2013 , 12:44   Re: [REQ] edit zp buy classes
Reply With Quote #3

u mean if 1 player buy then he cant buy anymode or 1 mode per map , can u explain better?
__________________
Quote:
Originally Posted by ghinghis View Post
the fuking TOP.SMA cannot be compiled moron !!!!!

Last edited by Cigojlo; 09-03-2013 at 12:44.
Cigojlo is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 09-03-2013 , 18:27   Re: [REQ] edit zp buy classes
Reply With Quote #4

u mean a player can buy one survivor, one nemesis, one assassin and one sniper then when u buy one of this the mode block or a player only can buy one mode any of four and then the rest mods block?

Last edited by wicho; 09-03-2013 at 18:29.
wicho is offline
marijuana666
Junior Member
Join Date: Dec 2010
Location: Romania, Turda
Old 09-03-2013 , 19:37   Re: [REQ] edit zp buy classes
Reply With Quote #5

exemple if i buy one mod i cant buy in that map anymore mod
just nextmap
__________________
marijuana666 is offline
marijuana666
Junior Member
Join Date: Dec 2010
Location: Romania, Turda
Old 09-04-2013 , 14:53   Re: [REQ] edit zp buy classes
Reply With Quote #6

UP!
__________________
marijuana666 is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 09-04-2013 , 15:06   Re: [REQ] edit zp buy classes
Reply With Quote #7

Dont make double post read the rules, just a question u want to block only this mode or all the mods when a player buy a mod? i dont understand much this part..

Last edited by wicho; 09-04-2013 at 15:10.
wicho 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 15:44.


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