|
发表于 2004-10-7 11:24:28
|
显示全部楼层
来自 中国–广西–柳州–柳北区
为什么21楼的那个SMA文件我在AMXX编译会出错?请问有编译好的提供吗?要AMXX下的。
D:\GAMES\Cs1.6中文版\cstrike\addons\amxx\scripting>sc covertopsv.sma
Small compiler 2.1.0 Copyright (c) 1997-2002, ITB CompuPhase
covertopsv.sma(1) : error 010: invalid function or declaration
1 Error.
不明白21楼的那个SMA文件有什么不对,总之我从www.amxmodx.org载了一个英文原版编译成功,然后对着修改了输出的文字成中文,再编译也成功。
下面是我自己用英文版改的:
- /* AMX ModX script.
- *
- * CovertOps © 2003, Phreak
- * inspired by Krypt-Keep3r
- * This file is provided as is (no warranties).
- *
- * Usage:
- * The Players can use "getclothes" to steal the clothes from
- * corpses.
- * After round end all models are turned back to normal.
- *
- * Setup:
- * CovertOps can be disabled by setting amx_covertops to 0
- *
- * Known Bugs:
- * After been switched to the other team (for example by a team balancer)
- * You will get the model you've used in your old team. FIXED by xmdxtremekiller
- *
- * Version history:
- * v1.0F
- * Converted to amxmodx and fixed bug mentioned as above and also added help in game.
- * v0.2a
- * - increased array size
- * v0.2
- * - added sound when taking clothes
- * - clothes can only be taken one time per round
- * v0.1
- * - initial version
- */
- #include <amxmodx>
- #include <cstrike>
- new pl_origins[33][3]
- new pl_skins[33][32]
- new bool:pl_carmouflaged[33] = {false,...}
- new bool:pl_taken[33] = {false,...}
- public get_clothes(id) {
- if (get_cvar_num("amx_covertops")==0)
- return PLUGIN_HANDLED
- if (!is_user_alive(id))
- return PLUGIN_HANDLED
- new cur_origin[3],players[32],pl_num=0,dist,last_dist=99999,last_id,model[32]
- get_user_origin(id,cur_origin,0)
- get_players(players,pl_num,"b")
- if (pl_num>0) {
- for (new i=0;i<pl_num;i++) {
- if (players[i]!=id) {
- dist = get_distance(cur_origin,pl_origins[players[i]])
- if (dist<last_dist) {
- last_id = players[i]
- last_dist = dist
- }
- }
- }
- if (last_dist<80) {
- if (pl_taken[last_id]) {
- client_print(id,print_chat,"这些服装已经换过!")
- return PLUGIN_CONTINUE
- }
- get_user_info(last_id,"model",model,31)
- get_user_info(id,"model",pl_skins[id],31)
- cs_set_user_model(id, model)
- pl_carmouflaged[id] = true
- pl_taken[last_id] = true
- emit_sound(id,CHAN_VOICE,"items/tr_kevlar.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
- client_print(id,print_chat,"你现在看起来象一个%s的摸样!",model)
- client_cmd(id,"say_team 我正在做间谍,别打我!")
- return PLUGIN_CONTINUE
- }
- }
- client_print(id,print_chat,"这附近没有服装可以换!")
- return PLUGIN_CONTINUE
- }
- public player_die() {
- new victim = read_data(2)
- get_user_origin(victim,pl_origins[victim],0)
- if (pl_carmouflaged[victim]) {
- cs_set_user_model(victim, pl_skins[victim])
- }
- return PLUGIN_CONTINUE
- }
- public new_round(id){
- if (pl_carmouflaged[id]) {
- cs_reset_user_model(id)
- pl_carmouflaged[id] = false
- } else {
- get_user_info(id,"model",pl_skins[id],31)
- }
- pl_taken[id] = false
- return PLUGIN_CONTINUE
- }
- public covert_help(id){
- client_print(id,print_chat,"你可以把 getclothes band到一个键上,如: bind f getclothes")
- client_print(id,print_chat,"可以是任意键,这样用起来方便的多.")
- return PLUGIN_CONTINUE
- }
- public plugin_precache(){
- precache_sound( "items/tr_kevlar.wav")
- return PLUGIN_CONTINUE
- }
- public plugin_init()
- {
- register_plugin("间谍服装","1.0F","Xmdxtremekiller")
- register_clcmd("say_team getclothes","covert_help")
- register_clcmd("say /covertops","covert_help")
- register_clcmd("getclothes","get_clothes")
- register_event("ResetHUD", "new_round", "b")
- register_event("DeathMsg","player_die","a")
- register_cvar("amx_covertops","1")
- return PLUGIN_CONTINUE
- }
复制代码
但是出现了一个新的问题,就是我编译出来的AMX插件输出文字是是乱码……
将源文件转成ASC以外的格式编译会出错,转成ASC格式编译成功但是文字是乱码,怎么解决?
而且游戏的时候屏幕提示已经换了衣服了,但是实际上还没有换,皮肤还是老样子,看地上的尸体皮肤也没有变化。 |
|