回复: 警察和土匪可以买AK和M4的插件修改请教!!!
游戏中输入say /m4 活着say /ak回复: 警察和土匪可以买AK和M4的插件修改请教!!!
/* 本插件由 AMXX-Studio 中文版自动生成*//* UTF-8 func by www.DT-Club.net */
#include <amxmodx>
#include <cstrike>
#include <fun>
//#define DEBUG
new bool:buyswitch
public plugin_init() {
register_plugin("buy m4&ak","2.3","kid741010")
register_clcmd("say /m4","M4")
register_clcmd("say /ak","AK")
register_cvar("m4cost","3100")
register_cvar("akcost","2500")
register_logevent("round_start",2,"0=World triggered","1=Round_Start")
//1.5就用这句
register_event("ResetHUD", "eResetHUD", "be")
//1.6就用这句
//register_event("HLTV","eResetHUD","a","a=0","2=0")
}
public M4(id) {
new m4cost = get_cvar_num("m4cost")
new money = cs_get_user_money(id)
if(!is_user_alive(id)) {
client_color(id, id, "^x04 Ti Shi^x03 You Are Dead?")
//client_print(id,print_chat,"Huo Zhe Mai^n")
return PLUGIN_CONTINUE
}
if(money < m4cost) {
client_color(id, id, "^x04 Ti Shi^x03 Huo Zhe Mai?")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)){ //增加行
client_color(id, id, "^x04 Ti Shi^x03 Mai BU le?^n")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04 Ti Shi ^x03 Shi JIan BU Gou!")
return PLUGIN_CONTINUE
}
else {
cs_set_user_money(id,money-m4cost)
give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id,CSW_M4A1,90)
}
return PLUGIN_CONTINUE
}
public AK(id) {
new akcost = get_cvar_num("akcost")
new moneyy = cs_get_user_money(id)
if(!is_user_alive(id)) {
client_color(id, id, "^x04 Ti Shi ^x03 You Are Dead ?")
return PLUGIN_CONTINUE
}
if(moneyy < akcost) {
client_color(id, id, "^x04 Ti Shi ^x03 mai bu le?")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)) { //增加行
client_color(id, id, "^x04 Ti Shi^x03mai bu le?^n")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04 Ti Shi^x03shijiabugou!")
return PLUGIN_CONTINUE
}
else {
cs_set_user_money(id,moneyy-akcost)
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id,CSW_AK47,90)
}
return PLUGIN_CONTINUE
}
public eResetHUD()
{
new Float:buytime=get_cvar_float("mp_buytime")*60
buyswitch=true
set_task(buytime,"buy")
}
public round_start()
{
client_print(0,print_chat,"Ct Ke yi Buy AK & T ke yi buy M4a1 say/m4 & say/ak")
}
public client_color(playerid, colorid, msg[])
{
message_begin(playerid?MSG_ONE:MSG_ALL,get_user_msgid("SayText"),_,playerid)
write_byte(colorid)
write_string(msg)
message_end()
} 编译不了啊,怎么搞得? 能否给一个能限定购买时间和地点的? 我想要个权限的
页:
[1]