Descarcare:
Code: Select all
#include <amxmodx>
#include <fun>
#include <zombieplague>
new g_ItemID
new HpAmount
#define itemcost 20
new itemname[] = "Buy 200 HP!"
new g_Limit[33]
new g_iMaxPlayers
public plugin_init()
{
register_plugin("Buy HP", "1.0" , "" )
HpAmount = register_cvar("zp_buyhp_amount", "200")
g_ItemID = zp_register_extra_item(itemname, itemcost, ZP_TEAM_HUMAN)
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
g_iMaxPlayers = get_maxplayers()
}
public event_new_round()
{
for(new id = 1; id <= g_iMaxPlayers; id++)
{
g_Limit[id] = 0
}
}
public zp_extra_item_selected(id, item)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(item == g_ItemID)
{
if(g_Limit[id] >= 2)
{
client_print(id, print_chat, "[ZP] You reached the limit of buying HP")
return ZP_PLUGIN_HANDLED
}
set_user_health(id, get_user_health(id) + get_pcvar_num(HpAmount))
client_print(id, print_chat, "[ZP] You bought HP!")
g_Limit[id]++
}
return PLUGIN_HANDLED
}
Versiune: 1.0
Link oficial: cspower / thexforce
Instalare:
1. Fisierul zp_extra_hphuman.sma il puneti in addons/amxmodx/scripting
2. Fisierul zp_extra_hphuman.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Code: Select all
zp_extra_hphuman.amxx
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
Code: Select all
zp_buyhp_amount - cat hp sa fie adaugat
Code: Select all
public zp_extra_item_selected(id, item)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED
if(item == g_ItemID)
{
if(g_Limit[id] >= 2)
{
client_print(id, print_chat, "[ZP] You reached the limit of buying HP")
return ZP_PLUGIN_HANDLED
}
set_user_health(id, get_user_health(id) + get_pcvar_num(HpAmount))
client_print(id, print_chat, "[ZP] You bought HP!")
g_Limit[id]++
}
return PLUGIN_HANDLED
}
Code: Select all
if(g_Limit[id] >= 2)
{
client_print(id, print_chat, "[ZP] You reached the limit of buying HP")
return ZP_PLUGIN_HANDLED
}
Code: Select all
if(g_Limit[id] >= 2)
Imagini: -