搜索
查看: 2108|回复: 5

slaylogo编译问题

[复制链接]
发表于 2009-3-18 17:46:19 | 显示全部楼层 |阅读模式 来自 中国–甘肃–兰州
本服原来用的这个插件无源码,加载后一直无法使用,今天翻了下,找到一个源码,但编译出错,请达人帮忙给修改下,谢谢!!!!

源码如下:
[php]#include <amxmodx>
#define MAX_DISTANCE 75 // detect distance...
#define MAX_PLAYERS 32 // server maximum players

new sprayidorigins[3]
new vorigin[MAX_PLAYERS][3]
new d_index


public plugin_init() {
register_plugin("Auto-logo punisher","0.01","[PAPA]PERt+")
register_event( "RoundTime", "reset_table", "bc" );
register_event("23", "checkspray", "a", "1=112")
register_event( "DeathMsg", "store_table", "a" );
server_cmd("cl_corpsestay 180")
}

public store_table() {

new victim = read_data( 2 );
new name[32]
get_user_name(victim, name , 31);
get_user_origin( victim, vorigin[d_index], 0 );
d_index++
return PLUGIN_CONTINUE;

}

public reset_table() {

d_index = 0
new i;
for (i=0; i < MAX_PLAYERS; i++) {
vorigin[0] = 0;
vorigin[1] = 0;
vorigin[2] = 0;
}

return PLUGIN_CONTINUE;
}


public checkspray() {
new sprayid = read_data(2) ;
sprayidorigins[0] = read_data(3);
sprayidorigins[1] = read_data(4);
sprayidorigins[2] = read_data(5);

new j;
for ( j=0; j < MAX_PLAYERS; j++) {
new distance = get_distance(vorigin[j], sprayidorigins);

if ( distance < MAX_DISTANCE ) {
new name[32]
get_user_name(sprayid,name,31)
client_cmd(sprayid,"kill")

client_print(0,print_chat, "[AMXX] 警告:玩家 %s 由于喷尸而被处死!",name)
user_kill(sprayid,1)
client_cmd(sprayid,"kill")
break
}
}

return PLUGIN_CONTINUE
}[/php]
发表于 2009-3-19 14:41:57 | 显示全部楼层 来自 中国–上海–上海–徐汇区
用这个试试看
#include <amxmod>
#define MAX_DISTANCE 75    // detect distance...
#define MAX_PLAYERS 32      // server maximum players
                                                                              
new sprayidorigins[3]
new vorigin[MAX_PLAYERS][3]
new d_index
                                                                              
                             
public plugin_init() {
       register_plugin("Auto-logo punisher","0.01","[PAPA]PERt+")
       register_event( "RoundTime", "reset_table", "bc" );
       register_event("23", "checkspray", "a", "1=112")        
       register_event( "DeathMsg", "store_table", "a" );
}
                                                                              
public store_table() {
                                                                              
       new victim = read_data( 2 );
       new name[32]
       get_user_name(victim, name , 31);
       get_user_origin( victim, vorigin[d_index], 0 );
       d_index++
       return PLUGIN_CONTINUE;
                                                                              
}
                                                                              
public reset_table() {
                                                                              
       d_index = 0
       new i;
       for (i=0; i < MAX_PLAYERS; i++) {
       vorigin[0] =  0;
       vorigin[1] =  0;
       vorigin[2] =  0;
       }
                                                                              
       return PLUGIN_CONTINUE;
}
                                                                              
                                                                              
public checkspray() {

       new sprayid = read_data(2)    ;
       sprayidorigins[0] = read_data(3);      
       sprayidorigins[1] = read_data(4);      
       sprayidorigins[2] = read_data(5);      
                                                                              
       new j;
       for ( j=0; j < MAX_PLAYERS; j++) {
       new distance = get_distance(vorigin[j], sprayidorigins);
                                                                              
       if ( distance < MAX_DISTANCE ) {
               new name[32]
               get_user_name(sprayid,name,31)
               client_cmd(sprayid,"kill")                                                                          
               client_print(0,print_chat, "玩家 %s 喷尸被处死! ",name)
               user_kill(sprayid,1)
               client_cmd(sprayid,"kill")
               break
               }
       }
                                                
       return PLUGIN_CONTINUE
}      
回复

使用道具 举报

 楼主| 发表于 2009-3-19 17:39:19 | 显示全部楼层 来自 中国–甘肃–兰州
谢谢楼上,我去试下
回复

使用道具 举报

 楼主| 发表于 2009-3-19 17:46:35 | 显示全部楼层 来自 中国–甘肃–兰州
landyhsu  你这个还是不能编译

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2009-3-19 20:21:14 | 显示全部楼层 来自 中国–上海–上海
不知道你用的AMXX是什么版本的,AMXX1.76及以上版本可以编译的。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2009-3-19 22:52:44 | 显示全部楼层 来自 中国–甘肃–天水
很奇怪,下载了你发的文件后可以使用,而且目前看很稳定。我用的AMXX1.76C自带的编译器编译,出错?难道是编译器问题??:dizzy:
回复

使用道具 举报

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

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