AE86 发表于 2005-8-26 08:44:31

不知道为什么我编译的不会显示我的中文语句 :sweat::sweat::sweat::sweat:

zats 发表于 2005-8-26 08:56:24

能不能仔细讲解一下呢?

AE86 发表于 2005-8-26 11:39:02

我编译了一个内网优先插件,可中文部分不显示不知道为什么,编译如下:
#include <amxmod>

public client_connect(id){
        new userip
        new ips
        new name
        new g_amx_netbarip
        get_user_ip(id,userip,16,1)
        copy(ips,7,userip)
        get_cvar_string("amx_netbarip",g_amx_netbarip,7)
        get_user_name(id,name,32)

        if (equali(ips,"192.168")){
                set_user_flags(id,read_flags("b"))
                client_print(0,print_chat,"*XX网吧优先玩家: %s (%s)",userip)
                new maxplayers = get_maxplayers()
                new players = get_playersnum( 1 )
                new limit = maxplayers - 1
                if( players > limit ){
                kickhping()       
                }
                }else{
                client_print(0,print_chat,"*外网: %s (%s)正在连接",name,userip)
                }
        //client_print(0,print_chat,"*test: %s |%s",ips,g_amx_netbarip)
        return PLUGIN_CONTINUE
}

kickhping() {
       
    new who = 0, ping, loss, worst = -1
    new maxplayers = get_maxplayers()
    for(new i = 1; i <= maxplayers; ++i) {
      if ( !is_user_connected(i) && !is_user_connecting(i) )
            continue // not used slot   
      if (get_user_flags(i)&ADMIN_RESERVATION)
            continue // has reservation, skip him
      get_user_ping(i,ping,loss) // get ping
      if ( ping > worst ) {
            worst = ping
            who = i
      }
    }
    if(who)
      if ( is_user_bot(who) )
            server_cmd("kick #%d", get_user_userid(who))
      else{
                client_cmd(who,"echo ^"*XX优先通道已踢出ping高者^";disconnect")
                client_print(0,print_chat,"*XX优先通道已踢出ping高者^")
                }
    return who
}

public plugin_init() {
   register_plugin("*XX优先通道","0.1","YanOnline")
   register_cvar("amx_netbarip","192.168")
   return PLUGIN_CONTINUE
}

liuzd 发表于 2005-8-26 18:23:54

顶,我也试试。
页: 1 [2]
查看完整版本: 用UltraEdit怎h化插件...