Raised This Month: $ Target: $400
 0% 

[HELP] limit buy HP


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
abood alnjjar
Member
Join Date: Oct 2015
Location: palestine
Old 11-26-2015 , 12:39   Re: [HELP] limit buy HP
Reply With Quote #6

be like this not work...how be ???

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

new const item_name[] = "Buy 2500 HP!"
new g_itemid_buyhp
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)
}
public 
zp_extra_item_selected(id,itemid)
{
    if(!
is_user_alive(id))
    
    return 
PLUGIN_HANDLED;
    
    if(
itemid==g_itemid_buyhp)
    {
        if(
zp_get_user_ammo_packs(id) < 5)
        {
            
client_print(idprint_chat,"[ZoZ] Not enough Ammopacks!");
            return 
PLUGIN_HANDLED;
        }
        else
        {
            
set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) - 5);
            
client_print(idprint_chat,"[ZoZ] You Bought HP!");
        }
    }
    return 
PLUGIN_CONTINUE;
}
new 
bool:g_iTem33 ]  // Create a bool for the item

public client_connectid )
{
    
g_iTemid ] = false  // set the bool to false when the player connect
}

public 
whatever_you_wantid )
{
    if( !
g_iTemid ] ) // check to see if it's true or false. if it's false give the player the item
    
{
        
give_itemid"your_weapon" )
        
g_iTemid ] = true // set it true when the player buy the item
    
}
}

public 
round_end()
{
    
arraysetg_iTem0sizeofg_iTem) ) // set it to false at the end of the round.
}  
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/ 
__________________

Last edited by Bugsy; 11-26-2015 at 14:42.
abood alnjjar is offline
 



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