Raised This Month: $ Target: $400
 0% 

[HELP] limit buy HP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 11-27-2015 , 03:43   Re: [HELP] limit buy HP
Reply With Quote #10

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

new const item_name[] = "Buy 2500 HP!"
new g_itemid_buyhpg_maxplayersbool:g_iTem[33]
new 
hpamount

public plugin_init() 
{
    
register_plugin("[ZoZ] Buy Health Points""1.0""T[h]E Dis[as]teR")
    
hpamount register_cvar("zp_buyhp_amount""2500")
    
g_itemid_buyhp zp_register_extra_item(item_name5ZP_TEAM_HUMAN ZP_TEAM_ZOMBIE)
    
register_event("HLTV""event_round_start""a""1=0""2=0")    
    
g_maxplayers get_maxplayers()
}

public 
zp_extra_item_selected(id,itemid)
{    
    if(
itemid==g_itemid_buyhp)
    {
        if(
g_iTem[id])
        {
            
client_print(idprint_chat,"[ZoZ] Not enough Ammopacks!");
            return 
ZP_PLUGIN_HANDLED
        
}
        
set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));
        
client_print(idprint_chat,"[ZP] You Bought HP!");
        
g_iTem[id] = true
    
}
    return 
PLUGIN_CONTINUE;
}

public 
client_connect(id)
{
    
g_iTem[id] = false
}

public 
event_round_start()
{
    for (new 
playerplayer <= g_maxplayersplayer++)
    {
        
g_iTem[player] = false
    
}

Did it for u bcuz i dont expect you to understand these
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
 



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 18:13.


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