搜索
查看: 1866|回复: 5

【教学】请专家进来一下

[复制链接]
发表于 2005-4-8 14:42:23 | 显示全部楼层 |阅读模式 来自 中国–广东–广州–天河区
编译时出现以下提示:

//// swear_filter.sma
// F:\amxx+2834 dcoo1.6\cstrike\addons\amxmodx\scripting\swear_filter.sma(133) :
error 017: undefined symbol "get_user_money"
// F:\amxx+2834 dcoo1.6\cstrike\addons\amxmodx\scripting\swear_filter.sma(140) :
error 017: undefined symbol "set_user_money"
//
// 2 Errors.
// Could not locate output file F:\amxx+2834 dcoo1.6\cstrike\addons\amxmodx\scri
pting\compiled\swear_filter.amx (compile failed).
//
// Compilation Time: 0.09 sec



以面是其代码

/* AMX Mod script.
*
* Based on a script by RAV
* Made By AssKicR
* Modified by deadBeat May - June 2003
* Modified by ypf(QQ:9931817) - Aug 2003
*/

//Uncomment If You Want Swearers to loose SuperHeroMod XP  
//#define RUN_WITH_SHM

#include <amxmodx>
#if defined(RUN_WITH_SHM)
#endif

// max number of words in word list
#define MAX_WORDS 192

// file to read words from
new g_swearsFile[] = "addons/amxmodx/ban-word/wordlist.cfg"

new g_swearsNames[MAX_WORDS][32]
new g_swearsNum



public plugin_init() {

register_plugin("Swear Filter","1.10","AssKicR/deadBeat")

register_clcmd("say","swearFilter")
register_clcmd("say_team","swearFilter")

register_cvar("sw_admin","1.0")
register_cvar("sw_warn","0.0")
register_cvar("sw_cashloss", "100")

readList( g_swearsFile )

return PLUGIN_CONTINUE
}

readList(filename[]) {

if(!file_exists(filename) ){
log_message("Swear Filter: file %s not found", filename)
return
}

new iLen

while ( (g_swearsNum < MAX_WORDS) &&
(read_file(filename, g_swearsNum, g_swearsNames[g_swearsNum][1],30,iLen))) {

g_swearsNames[g_swearsNum][0] = iLen

++g_swearsNum
}

log_message("Swear Filter: loaded %d words",g_swearsNum )
}

public swearFilter(id) {

if ((get_cvar_num("sw_admin") > 0) && (get_user_flags(id) > 0))
return PLUGIN_CONTINUE

new szSaid[192]

read_args(szSaid,191)

new bool:found = false

new pos, i = 0

if (containi(szSaid,"MiB v")!=-1) {

engclient_cmd(id,"disconnect");

return PLUGIN_HANDLED
}

new cmd1[80]

new saycmd[32]

new obj[32]

read_argv(1,cmd1,79)

parse(cmd1,saycmd,31,obj,31)

if (equal(saycmd,"MAP") && is_map_valid(obj)) {

client_cmd(id,"amx_votemap %s",obj)

return PLUGIN_HANDLED
}

if (equal(saycmd,"KICK") || equal(saycmd,"BAN")) {

strtolower(saycmd)

client_cmd(id,"amx_vote%s %s",saycmd,obj)

return PLUGIN_HANDLED
}

if (containi(szSaid,"huan guan")!=-1||containi(szSaid,"huan map")!=-1||containi(szSaid,"change map")!=-1||containi(szSaid,"huan tu")!=-1||containi(szSaid,"huan di tu")!=-1) client_print(0,print_chat,"Say 'MAP mapname' to change map")

if (containi(szSaid,"zuo bi")!=-1||containi(szSaid,"zuobi")!=-1) client_print(0,print_chat,"Say 'KICK name' or 'BAN name'")

while (i < g_swearsNum) {

if ((pos = containi(szSaid,g_swearsNames[1])) != -1 ){

new len = g_swearsNames[0]

while(len--) szSaid[pos++] = '*'

found = true

continue
}

++i
}

if (found) {

new cmd[32]

new money = get_user_money(id)

new loss = get_cvar_num("sw_cashloss")

if (money < loss)
loss = money

set_user_money(id, money - loss,1)
#if defined(RUN_WITH_SHM)
shAddXP(id, id, -1)
#endif
if (loss > 0)
client_print(id,print_chat,"[AMXX] You have been fined $%i for swearing.",loss)

read_argv(0,cmd,31)

engclient_cmd(id,cmd,szSaid)

if (get_cvar_num("sw_warn") > 0) {

set_hudmessage(220,80,0, 0.05, 0.50, 2, 0.1, 3.0, 0.02, 0.02, 10)

show_hudmessage(id,"WATCH YOUR LANGUAGE^nYou have been fined $%i for swearing!",loss)

}
return PLUGIN_HANDLED

}
return PLUGIN_CONTINUE
}




请问如何定义那些钱啊?

谢谢指教
发表于 2005-4-8 14:48:50 | 显示全部楼层 来自 中国–河南–安阳
AMX插件 代码你自己修改过了吧 贴的不是源码
回复

使用道具 举报

发表于 2005-4-8 14:54:19 | 显示全部楼层 来自 中国–河北–承德
谁有原码弄上来看看
没找到下的地方。。。。。。。。
回复

使用道具 举报

 楼主| 发表于 2005-4-8 14:56:41 | 显示全部楼层 来自 中国–广东–广州–天河区
只改了几处。
#include <amxmod> 改为 #include <amxmodx>
#include <superheromod> 这句去掉了
new g_swearsFile[] = "addons/amx/wordlist.cfg" 改为new g_swearsFile[] = "addons/amxmodx/ban-word/wordlist.cfg"

其它的就不动了。(也不知如何动手)
回复

使用道具 举报

 楼主| 发表于 2005-4-8 15:06:28 | 显示全部楼层 来自 中国–广东–广州–天河区
可否改为AMXX的?
回复

使用道具 举报

 楼主| 发表于 2005-4-8 15:35:58 | 显示全部楼层 来自 中国–广东–广州–天河区
我改好了。编译成功了。for amxx1.0
但还没有测试。
回复

使用道具 举报

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

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