|
发表于 2010-2-27 12:49:55
|
显示全部楼层
|阅读模式
来自 中国–黑龙江–齐齐哈尔
可以买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[13];
- 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;
复制代码 |
|