Spoiler :
#include < amxmodx >
#include < fakemeta >
#include < zp50_core >
#include < zp50_items >
#include < zp50_items_const >
#define PLUGIN "[ZP] Item: Anti-Infection Armor"
#define VERSION "1.0"
#define AUTHOR "GuhRDS"
#define ITEM_ARMOR_NAME "Anti-Infection Armor"
#define ITEM_ARMOR_COST 5
new const g_buy_armor[] = "items/tr_kevlar.wav"
const g_armor_amount = 100
const g_armor_limit = 999
new g_ArmorId
public plugin_precache()
{
precache_sound(g_buy_armor)
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_ArmorId = zp_items_register(ITEM_ARMOR_NAME, ITEM_ARMOR_COST)
}
public zp_fw_items_select_pre(id, itemid, ignorecost)
{
if (itemid != g_ArmorId)
return ZP_ITEM_AVAILABLE;
if (zp_core_is_zombie(id))
return ZP_ITEM_DONT_SHOW;
return ZP_ITEM_AVAILABLE;
}
public zp_fw_items_select_post(id, itemid, ignorecost)
{
if (itemid != g_ArmorId)
return;
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_buy_armor, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_pev(id, pev_armorvalue, float(min(pev(id, pev_armorvalue)+g_armor_amount, g_armor_limit)))
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
#include < fakemeta >
#include < zp50_core >
#include < zp50_items >
#include < zp50_items_const >
#define PLUGIN "[ZP] Item: Anti-Infection Armor"
#define VERSION "1.0"
#define AUTHOR "GuhRDS"
#define ITEM_ARMOR_NAME "Anti-Infection Armor"
#define ITEM_ARMOR_COST 5
new const g_buy_armor[] = "items/tr_kevlar.wav"
const g_armor_amount = 100
const g_armor_limit = 999
new g_ArmorId
public plugin_precache()
{
precache_sound(g_buy_armor)
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_ArmorId = zp_items_register(ITEM_ARMOR_NAME, ITEM_ARMOR_COST)
}
public zp_fw_items_select_pre(id, itemid, ignorecost)
{
if (itemid != g_ArmorId)
return ZP_ITEM_AVAILABLE;
if (zp_core_is_zombie(id))
return ZP_ITEM_DONT_SHOW;
return ZP_ITEM_AVAILABLE;
}
public zp_fw_items_select_post(id, itemid, ignorecost)
{
if (itemid != g_ArmorId)
return;
engfunc(EngFunc_EmitSound, id, CHAN_BODY, g_buy_armor, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_pev(id, pev_armorvalue, float(min(pev(id, pev_armorvalue)+g_armor_amount, g_armor_limit)))
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
Link Plugin AMXX: zp50_item_anti-infection_armor.amxx
@ EDIT
Arrumado bug ao comprar o som da compra do colete não tocava
Última edição por guh._.rds em 25/4/2012, 7:31 pm, editado 5 vez(es)