wwww23 发表于 2008-6-29 22:44:09

jim_yang大哥不在,哪位大哥会看代码的帮忙一下谢谢

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <memhack>
public plugin_init()
{
register_plugin("Slots Reservation","1.0","Lu0007")
register_cvar("amx_reservation","1")
#if defined HIDE_RESERVEDSLOTS
set_cvar_num( "sv_visiblemaxplayers" , get_maxplayers() - 1 )
#endif
}
//玩家进入初始化
public client_authorized(id) {
new name
get_name(id,name,32) //返回玩家名
new maxplayers = get_maxplayers() //返回游戏最大人数
new players = get_playersnum( 1 ) //统计人数 ,连正在连接的也算
new limit = maxplayers - get_cvar_num("amx_reservation") //服最大人数 减去预留人数
//当超过限制人数时
if ( players > limit )
{
//进入的VIP&&OP 或是内网地址如192.168 或是有内网IP段的如 10.0
if ( get_user_flags(id) & ADMIN_RESERVATION)
{
new szname,ping,loss,worst=-1
set_user_flags(id, get_user_flags(id)|ADMIN_IMMUNITY)
//set_user_flags(id,read_flags("b"))
//设置玩家标记,b 为可通过预留通道加入服务器
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
new CsTeams:userTeam = cs_get_user_team(i)
if ( userTeam == CS_TEAM_SPECTATOR ) {
server_cmd("kick #%d [提示] 服满VIP进入踢观察者!请稍后再进入.", get_user_userid(i) )
} else
get_user_name(i,szname,31)
if (contain(szname, "") != -1){
server_cmd("kick #%d [提示] 服满VIP进服踢无SXE!请安装SXE再进.", get_user_userid(i) )
}
}
}
else { //是人的,提示并踢除
server_cmd("kick #%d 提示:VIP预留通道!请稍后再进。", get_user_userid(id) )
}
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
出现
L 06/29/2008 - 14:15:42: Invalid player 8
L 06/29/2008 - 14:15:42: Displaying debug trace (plugin "slots_reservation_CN_Lu0007.amxx")
L 06/29/2008 - 14:15:42: Run time error 10: native error (native "cs_get_user_team")
L 06/29/2008 - 14:15:42: slots_reservation_CN_Lu0007.sma::client_authorized (line 41)
L 06/29/2008 - 14:47:34: Start of error session.
L 06/29/2008 - 14:47:34: Info (map "de_inferno") (logfile "error_062908.log")
L 06/29/2008 - 14:47:34: Invalid player 28
L 06/29/2008 - 14:47:34: Displaying debug trace (plugin "slots_reservation_CN_Lu0007.amxx")
L 06/29/2008 - 14:47:34: Run time error 10: native error (native "cs_get_user_team")
L 06/29/2008 - 14:47:34: slots_reservation_CN_Lu0007.sma::client_authorized (line 41)
L 06/29/2008 - 14:56:04: replace() buffer not big enough (129>=127)
L 06/29/2008 - 14:56:04: Run time error 10 (plugin "statsx.amxx") (native "replace") - debug not enabled!
L 06/29/2008 - 14:56:04: To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2008 - 14:56:10: replace() buffer not big enough (129>=127)
L 06/29/2008 - 14:56:10: Run time error 10 (plugin "statsx.amxx") (native "replace") - debug not enabled!
L 06/29/2008 - 14:56:10: To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 06/29/2008 - 15:22:34: Start of error session.
L 06/29/2008 - 15:22:34: Info (map "828_dust3") (logfile "error_062908.log")
L 06/29/2008 - 15:22:34: Invalid player 2
L 06/29/2008 - 15:22:34: Displaying debug trace (plugin "slots_reservation_CN_Lu0007.amxx")
L 06/29/2008 - 15:22:34: Run time error 10: native error (native "cs_get_user_team")
L 06/29/2008 - 15:22:34: slots_reservation_CN_Lu0007.sma::client_authorized (line 41)
L 06/29/2008 - 16:27:48: Start of error session.
L 06/29/2008 - 16:27:48: Info (map "de_nuke") (logfile "error_062908.log")
L 06/29/2008 - 16:27:48: Invalid player 12
L 06/29/2008 - 16:27:48: Displaying debug trace (plugin "slots_reservation_CN_Lu0007.amxx")
L 06/29/2008 - 16:27:48: Run time error 10: native error (native "cs_get_user_team")
L 06/29/2008 - 16:27:48: slots_reservation_CN_Lu0007.sma::client_authorized (line 41)
L 06/29/2008 - 17:47:18: Start of error session.
L 06/29/2008 - 17:47:18: Info (map "de_aztec") (logfile "error_062908.log")
L 06/29/2008 - 17:47:18: Invalid player 28
L 06/29/2008 - 17:47:18: Displaying debug trace (plugin "slots_reservation_CN_Lu0007.amxx")
L 06/29/2008 - 17:47:18: Run time error 10: native error (native "cs_get_user_team")
L 06/29/2008 - 17:47:18: slots_reservation_CN_Lu0007.sma::client_authorized (line 41)
L 06/29/2008 - 19:35:04: Start of error session.
L 06/29/2008 - 19:35:04: Info (map "de_dust2") (logfile "error_062908.log")
L 06/29/2008 - 19:35:04: Invalid player 15
L 06/29/2008 - 19:35:04: Displaying debug trace (plugin "slots_reservation_CN_Lu0007.amxx")
L 06/29/2008 - 19:35:04: Run time error 10: native error (native "cs_get_user_team")
L 06/29/2008 - 19:35:04: slots_reservation_CN_Lu0007.sma::client_authorized (line 41)

请问是什么原因?谢谢。

wwww23 发表于 2008-7-1 02:38:13

回复: jim_yang大哥请问这个怎么改?

:confused: ,弄得挂服两次了,大哥哪去了?
页: [1]
查看完整版本: jim_yang大哥不在,哪位大哥会看代码的帮忙一下谢谢