刘半仙【仙】
发表于 2012-8-26 15:33:42
hackroad 发表于 2012-8-26 09:29 static/image/common/back.gif
无源码。。。。
源码可以贴出来啊。。
重点无人想要。。~
刘半仙【仙】
发表于 2012-8-26 15:39:13
代码为乌龟原创,朋友需要 帮忙修改~
大家用得上就用#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "o4 +3 4 5"
#define VERSION "1.0"
#define AUTHOR "原wugui作品,Kyo半仙修改"
new g_MsgidTextMsg, g_Buymoney, Float:g_GameTime;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("EventStartRound", 2, "0=World triggered", "1=Round_Start");
register_event("HLTV", "EventStartRound", "a", "1=0", "2=0");
register_menucmd(register_menuid("BuyItem", 1), 511, "menuItem");
g_Buymoney = register_cvar("amx_grenade_money", "300");
g_MsgidTextMsg = get_user_msgid("TextMsg");
}
public EventStartRound()
g_GameTime = get_gametime();
public menuItem(id, key)
{
if(key == 3)
{
buy_hegren(id);
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public client_command(id)
{
new arg;
if(read_argv(0, arg, 12) > 11) return PLUGIN_CONTINUE;
if(equali(arg, "hegren"))
{
buy_hegren(id);
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public buy_hegren(id)
{
new Float:buytime, Float:timepassed, g_money, g_currentHE, CannotTime;
timepassed = get_gametime() - g_GameTime;
buytime = get_cvar_float("mp_buytime") * 60.0;
if(!is_user_connected(id)) return PLUGIN_HANDLED;
if(!cs_get_user_buyzone(id)) return PLUGIN_HANDLED;
if(floatcmp(timepassed , buytime) == 1)
{
num_to_str(floatround(get_cvar_float("mp_buytime") * 60.0, floatround_round), CannotTime, charsmax(CannotTime));
buy_message(id, "#Cant_buy", CannotTime);
return PLUGIN_HANDLED;
}
g_money = cs_get_user_money(id);
if(g_money < get_pcvar_num(g_Buymoney))
{
buy_message(id, "#Not_Enough_Money", "");
return PLUGIN_HANDLED;
}
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 - 300);
}
else
{
if(get_user_flags(id) & ADMIN_LEVEL_A)
{
if(g_currentHE <= 4)
{
new ikyot,K_name
get_user_name(id, K_name, 31);
cs_set_user_bpammo(id, CSW_HEGRENADE, 0);
give_item (id, "weapon_hegrenade");
cs_set_user_bpammo(id, CSW_HEGRENADE, g_currentHE + 1);
cs_set_user_money(id, g_money - 300);
format(ikyot,111,"^x04 %s^x03使用多雷卡^x04购买手雷,他最多可带5个手雷",K_name)
client_color(0, id, ikyot)
}
else
{
buy_message(id, "#Cannot_Carry_Anymore", "");
}
}
if(get_user_flags(id) & ADMIN_LEVEL_B)
{
if(g_currentHE <= 3)
{
new ikyot,K_name
get_user_name(id, K_name, 31);
cs_set_user_bpammo(id, CSW_HEGRENADE, 0);
give_item (id, "weapon_hegrenade");
cs_set_user_bpammo(id, CSW_HEGRENADE, g_currentHE + 1);
cs_set_user_money(id, g_money - 300);
format(ikyot,111,"^x04 %s^x03使用多雷卡^x04购买手雷,他最多可带4个手雷",K_name)
client_color(0, id, ikyot)
}
else
{
buy_message(id, "#Cannot_Carry_Anymore", "");
}
}
if(get_user_flags(id) & ADMIN_LEVEL_C)
{
if(g_currentHE <= 2)
{
new ikyot,K_name
get_user_name(id, K_name, 31);
cs_set_user_bpammo(id, CSW_HEGRENADE, 0);
give_item (id, "weapon_hegrenade");
cs_set_user_bpammo(id, CSW_HEGRENADE, g_currentHE + 1);
cs_set_user_money(id, g_money - 300);
format(ikyot,111,"^x04 %s^x03使用多雷卡^x04购买手雷,他最多可带3个手雷",K_name)
client_color(0, id, ikyot)
}
else
{
buy_message(id, "#Cannot_Carry_Anymore", "");
}
}
else
{ buy_message(id, "#Cannot_Carry_Anymore", "")
}
}
return PLUGIN_HANDLED;
}
public buy_message(id, message[], more[])
{
message_begin(MSG_ONE, g_MsgidTextMsg, _, id);
write_byte(4);
write_string(message);
if(strlen(more) > 0)
write_string(more);
message_end();
}
public client_color(playerid,colorid,msg[])
{
message_begin(playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
刘半仙【仙】
发表于 2012-8-26 15:41:42
旧的不去新的 发表于 2012-8-25 23:40 static/image/common/back.gif
赚积分的。。。
源已贴~:)
15zi 15 zi 15 字字字
刘半仙【仙】
发表于 2012-8-26 15:42:53
36503008 发表于 2012-8-26 10:01 static/image/common/back.gif
无乱码。。。
已贴 15字字字字
刘半仙【仙】
发表于 2012-8-26 15:44:42
hackroad 发表于 2012-8-26 09:29 static/image/common/back.gif
无源码。。。。
已贴~~~ 字字字字
denitk
发表于 2012-8-26 20:06:13
无源码的话只要木有广告就一切OK
刘半仙【仙】
发表于 2012-8-27 09:08:45
denitk 发表于 2012-8-26 20:06 static/image/common/back.gif
无源码的话只要木有广告就一切OK
已贴源码。。
这东西- -渣渣。。。
没广告的。
385897365
发表于 2012-8-27 12:39:08
hackroad
发表于 2012-8-28 23:49:50
已经采用~~
maxtor1234
发表于 2012-8-29 12:58:51
本帖最后由 刘半仙【仙】 于 2012-8-26 15:40 编辑
利用 乌龟的3雷改的。
貌似乌龟的 权限设置if 语句逻辑有错误。。
所以权限不生效