求助、高手来啊...不能在购买区购买
本帖最后由 wzx616313359 于 2010-4-27 19:09 编辑[*]求帮助啊~! 能编译了 。但是在购买区 买不了武器 - -
抑郁死了啊~!!! 谁能帮帮忙啊~! 或者直接给我一个无购买Bug的Amxx啊!
#include <amxmodx>
#include <cstrike>
#include <fun>
//#define DEBUG
new bool:buyswitch
public plugin_init() {
register_plugin("buy m4ak","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^x03Ling Huen Hai Neng Yong Qiang?")
//client_print(id,print_chat,"Huo ZHe Cai Neng Mai^n")
return PLUGIN_CONTINUE
}
if(money < m4cost) {
client_color(id, id, "^x04^x03Mei You Qian Hai Xiang Mai Qiang?")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)){ //增加行
client_color(id, id, "^x04^x03Ni Yi Jing You Wu Qi Le?^n")
return PLUGIN_CONTINUE
}
if(!cs_get_user_buyzone(id)){
client_color(id, id, "^x04^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04^x03Gou Mai Shi Jian Yi Guo!")
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^x03Ling Huen Hai Neng Yong Qiang?")
return PLUGIN_CONTINUE
}
if(moneyy < akcost) {
client_color(id, id, "^x04^x03Mei You Qian Hai Xiang Mai Qiang?")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)) {//增加行
client_color(id, id, "^x04^x03Ni Yi Jing You Wu Qi Le?^n")
return PLUGIN_CONTINUE
}
if(!cs_get_user_buyzone(id)){
client_color(id, id, "^x04^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04^x03Gou Mai Shi Jian Yi Guo!")
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 buy()
{
buyswitch=false
}
public round_start()
{
client_print(0,print_chat,"CT Gou Mai AK T Gou Mai 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()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/ 抑郁 、、、、 不能沉下去、、、 #include <amxmodx>
#include <cstrike>
#include <fun>
//#define DEBUG
new bool:buyswitch
public plugin_init() {
register_plugin("buy m4ak","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^x03Ling Huen Hai Neng Yong Qiang?")
//client_print(id,print_chat,"Huo ZHe Cai Neng Mai^n")
return PLUGIN_CONTINUE
}
if(money < m4cost) {
client_color(id, id, "^x04^x03Mei You Qian Hai Xiang Mai Qiang?")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)){ //增加行
client_color(id, id, "^x04^x03Ni Yi Jing You Wu Qi Le?^n")
return PLUGIN_CONTINUE
}
if(!cs_get_user_buyzone(id)){
client_color(id, id, "^x04^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04^x03Gou Mai Shi Jian Yi Guo!")
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^x03Ling Huen Hai Neng Yong Qiang?")
return PLUGIN_CONTINUE
}
if(moneyy < akcost) {
client_color(id, id, "^x04^x03Mei You Qian Hai Xiang Mai Qiang?")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)) {//增加行
client_color(id, id, "^x04^x03Ni Yi Jing You Wu Qi Le?^n")
return PLUGIN_CONTINUE
}
if(!cs_get_user_buyzone(id)){
client_color(id, id, "^x04^x03Zhi Neng Zai Gou Mai Qu Gou Mai!")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04^x03Gou Mai Shi Jian Yi Guo!")
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 buy()
{
buyswitch=false
}
public round_start()
{
client_print(0,print_chat,"CT Gou Mai AK T Gou Mai 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()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset134 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2052\\ f0\\ fs16 \n\\ par }
*/
没什么问题嘛,可以通过编译,只是有部分警告,因为代码未对齐,对齐代码之后无任何警告和错误。 本帖最后由 wzx616313359 于 2010-4-27 18:38 编辑
不能在购买区 买武器啊 !!!! 还是不行、、在购买区 买不了枪 - -
抑郁啊~! 4# 20576526
不能在购买区购买 呜呜、、、 不能沉、、、、 汗~! 点通没人了么?
页:
[1]
2