fuworm21so
|
分享:
▲
▼
下面是引用 sk@.@ 于 2010-06-05 18:30 发表的 : public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { if (victim != attacker || is_user_connected(attacker)) { new armor = get_user_armor(victim) if (armor > 0) { damage = (damage * 0) ....... 复制程式
#include <amxmodx>
#include <zombieplague>
#include <cstrike>
new g_itemid1,g_itemid2
new cvar_cost1,cvar_cost2
new const g_item_name1[] = { "道具1" }
new const g_item_name2[] = { "道具2" }
public plugin_init()
{
register_plugin("1.0", "1.0", "1.0")
cvar_cost1= register_cvar("zp_item1_cost", "2")//道具1价格
cvar_cost2= register_cvar("zp_item2_cost", "4")//道具2价格
g_itemid1= zp_register_extra_item(g_item_name1, get_pcvar_num(cvar_cost1), ZP_TEAM_HUMAN)
g_itemid2= zp_register_extra_item(g_item_name2, get_pcvar_num(cvar_cost2), ZP_TEAM_HUMAN)
}
public zp_extra_item_selected (id, itemid)
{
if (itemid == g_itemid1)
{
client_print(id, print_chat, "[ZP] 你购买了道具1.")
cs_set_user_armor(id ,150 ,CS_ARMOR_KEVLAR)
}
if (itemid == g_itemid2)
{
client_print(id, print_chat, "[ZP] 你购买了道具2.")
cs_set_user_armor(id ,300 ,CS_ARMOR_KEVLAR)
}
return PLUGIN_CONTINUE;
}
请问要加到那里呢?..
|
|
x0
[2 楼]
From:香港城市电讯 | Posted:2010-06-05 20:01 |
|
|
HsK
CCN@HsK
级别: 版主
版区: CS插件区
x1701
x1108
|
分享:
▲
▼
#include <amxmodx> #include <zombieplague> #include <cstrike>
new g_itemid1,g_itemid2 new cvar_cost1,cvar_cost2 new bool:item1[33], bool:item2[33]
new const g_item_name1[] = { "道具1" } new const g_item_name2[] = { "道具2" }
public plugin_init(){ register_plugin("1.0", "1.0", "1.0") cvar_cost1= register_cvar("zp_item1_cost", "2")//道具1价格 cvar_cost2= register_cvar("zp_item2_cost", "4")//道具2价格 g_itemid1= zp_register_extra_item(g_item_name1, get_pcvar_num(cvar_cost1), ZP_TEAM_HUMAN) g_itemid2= zp_register_extra_item(g_item_name2, get_pcvar_num(cvar_cost2), ZP_TEAM_HUMAN)
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage") register_forward(FM_PlayerPreThink, "fw_PlayerPreThink") } public zp_extra_item_selected (id, itemid) { if (itemid == g_itemid1){ item1[id] = true client_print(id, print_chat, "[ZP] 你购买了道具1.") cs_set_user_armor(id ,150 ,CS_ARMOR_KEVLAR) }
if (itemid == g_itemid2){ item2[id] = true client_print(id, print_chat, "[ZP] 你购买了道具2.") cs_set_user_armor(id ,300 ,CS_ARMOR_KEVLAR) } }
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type) { if (victim != attacker || is_user_connected(attacker)) { if (item1[victim] || item2[victim]){ new armor = get_user_armor(victim) if (armor > 0) { damage = (damage * 0) SetHamParamFloat(4, damage) } } } }
public fw_PlayerPreThink(id) { if (is_user_alive(id) || item1[id] || item2[id]) { new armor = get_user_armor(id) if (armop <= 0){ item1[id] = false item2[id] = false } }
if (zp_get_user_zombie(id)) { item1[id] = false item2[id] = false }
if (!is_user_alive(id)) { item1[id] = false item2[id] = false } }
|
HsK-Dev Blog By CCN
|
x1
[3 楼]
From:香港有线宽频 | Posted:2010-06-05 20:45 |
|
|
|