搜索
查看: 2341|回复: 2

帮忙改编插件,关于金钱

[复制链接]
发表于 2008-7-29 14:08:11 | 显示全部楼层 |阅读模式 来自 中国–广东–深圳–福田区
我在论坛下载的BUY_M4_AK

在插件源代码前面加上: #include <unlimited_money>

修改函数 
  
cs_get_user_money2(id)

cs_set_user_money2(id, money, flash=1)

无法编译,这个问题一直没能解决,又得麻烦论坛的兄弟帮忙了,谢谢!

用RYU版主改编的编译器可以编译但无法使用。
#include <amxmodx>
#include <cstrike>
#include <fun>
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","3000")
register_cvar("akcost","2500")
register_logevent("round_start",2,"0=World triggered","1=Round_Start")
register_event("HLTV", "EVENT_NewRound", "a", "1=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【温馨提示】^x03已经阵亡的玩家是不可以购买武器的。")
return PLUGIN_CONTINUE
}
if(money < m4cost) {
client_color(id, id, "^x04【温馨提示】^x03很抱歉,你没有足够的资金。")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)){
client_color(id, id, "^x04【温馨提示】^x03注意,你已经拥有一个主武器了。")
return PLUGIN_CONTINUE
}
if(!cs_get_user_buyzone(id)){
client_color(id, id, "^x04【温馨提示】^x03玩家只能在购买区内购买武器。")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04【温馨提示】^x03很抱歉,购买武器的时间已经过了。")
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 money = cs_get_user_money(id)
if(!is_user_alive(id)) {
client_color(id, id, "^x04【温馨提示】^x03已经阵亡的玩家是不可以购买武器的。")
return PLUGIN_CONTINUE
}
if(money < akcost) {
client_color(id, id, "^x04【温馨提示】^x03很抱歉,你没有足够的资金。")
return PLUGIN_CONTINUE
}
if (cs_get_user_hasprim(id)) {
client_color(id, id, "^x04【温馨提示】^x03注意,你已经拥有一个主武器了。")
return PLUGIN_CONTINUE
}
if(!cs_get_user_buyzone(id)){
client_color(id, id, "^x04【温馨提示】^x03玩家只能在购买区内购买武器。")
return PLUGIN_CONTINUE
}
if(!buyswitch){
client_color(id, id, "^x04【温馨提示】^x03很抱歉,购买武器的时间已经过了。")
return PLUGIN_CONTINUE
}
else
{
cs_set_user_money(id,money-akcost)
give_item(id, "weapon_ak47")
cs_set_user_bpammo(id,CSW_AK47,90)
}
return PLUGIN_CONTINUE
}
public EVENT_NewRound()
{
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,"* 警察可以购买 AK-47 & 匪徒可以购买 M4A1,输入 /m4 & /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()
}
发表于 2008-7-29 20:47:17 | 显示全部楼层 来自 中国–江西–抚州

回复: 帮忙改编插件,关于金钱

那很有可能是utf - 8的问题...
回复

使用道具 举报

发表于 2008-7-29 22:48:04 | 显示全部楼层 来自 中国–福建–漳州

回复: 帮忙改编插件,关于金钱

有没有使用金钱无上限插件?unlimited_money.inc有没有放到include文件夹下?如果还不行,把编译出错的截图发上来看看。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表