高手帮我把这个插件加个权限
可以买3颗手雷的插件加上只有p - custom level D权限才能购买/*
Plugin author { DT.Sakulekingz \ KIN \ KzFun.wUgu1 \ k1nader }
__....__ 1. DT.Sakulekingz is KIN,
.-~~/\__/\~~-. 2. KIN is KzFun.wUgu1,
/_/``\__/\__/``\_\.--. 3. KzFun.wUgu1 is k1nader,
/\__/\__/\__/\ o`. 4. k1nader is DT.Sakulekingz,
`==/\__/__\__/__\__/__\__/\`'--' 5. so..DT.Sakulekingz = KIN = KzFun.wUgu1 = k1nader
~/__/__/^^^^^^^^\__\__\~ 6. DT.Sakuleking, KIN, KzFun.wUgu1, k1nader (the 4 names is me).
*/
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "buy 3 hegrenade"
#define VERSION "1.0"
#define AUTHOR "k1nader"
new g_hegrenademoney;
new bool:buyswitch;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_menucmd(register_menuid("BuyItem", 1), 511, "menuItem");
register_event("HLTV", "roundstart", "a", "1=0", "2=0");
g_hegrenademoney = register_cvar("amx_buygrenade", "300");
}
public client_command(id)
{
new arg;
if(read_argv(0, arg, 12) > 11) return PLUGIN_CONTINUE;
if(equali(arg, "hegren"))
{
if(!cs_get_user_buyzone(id)) return PLUGIN_HANDLED;
if(!buyswitch)
{
client_print(id, print_center, "%d 秒已经过去了,你不能再买任何东西了。",floatround(get_cvar_float("mp_buytime")*60,floatround_round));
return PLUGIN_HANDLED;
}
new g_money = cs_get_user_money(id);
if(g_money < get_pcvar_num(g_hegrenademoney))
{
client_print(id, print_center, "你没有足够的资金!");
return PLUGIN_HANDLED;
}
new g_currentHE = cs_get_user_bpammo(id, CSW_HEGRENADE);
if(g_currentHE == 0)
{
give_item(id, "weapon_hegrenade");
cs_set_user_money(id, g_money - get_pcvar_num(g_hegrenademoney));
}
else
{
if(g_currentHE <= 2)
{
cs_set_user_money(id, g_money - get_pcvar_num(g_hegrenademoney));
cs_set_user_bpammo(id, CSW_HEGRENADE, g_currentHE+1);
}
else
client_print(id, print_center, "你不能再携带任何东西了。");
}
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public menuItem(id, key)
{
if(key == 3)
{
if(!cs_get_user_buyzone(id)) return PLUGIN_HANDLED;
if(!buyswitch)
{
client_print(id, print_center, "%d 秒已经过去了,你不能再买任何东西了。",floatround(get_cvar_float("mp_buytime")*60,floatround_round));
return PLUGIN_HANDLED;
}
new g_money = cs_get_user_money(id);
if(g_money < get_pcvar_num(g_hegrenademoney))
{
client_print(id, print_center, "你没有足够的资金!");
return PLUGIN_HANDLED;
}
new g_currentHE = cs_get_user_bpammo(id, CSW_HEGRENADE);
if(g_currentHE == 0)
{
cs_set_user_money(id, g_money - get_pcvar_num(g_hegrenademoney));
give_item(id, "weapon_hegrenade");
}
else
{
if(g_currentHE <= 2)
{
cs_set_user_money(id, g_money - get_pcvar_num(g_hegrenademoney));
cs_set_user_bpammo(id, CSW_HEGRENADE, g_currentHE+1);
}
else
client_print(id, print_center, "你不能再携带任何东西了。");
}
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public roundstart()
{
new Float:buytime = get_cvar_float("mp_buytime") * 60;
buyswitch = true;
set_task(buytime, "canntbuy");
}
public canntbuy()
buyswitch = false; 不错 这个插件好 帮你、顶下帖子 那个积分 ding !!!!!!!!! 本帖最后由 sakulekingz 于 2010-3-5 08:00 编辑
**** Hidden Message *****
amx_buygrenade <需要多少金钱购买:默认 300>
amx_grenade_access <需要购买的权限:默认 p> 看看什么插件 如果是DOD游戏的插件,我可以帮你加,但CS,我不玩。 4# sakulekingz
看看龟仙人的东西 看要技术 还是龟仙人。 LOOK 1 LOOK ````````````