Quote:
Originally Posted by Sutar
as said striker07, get_playersnum() - Not the player who enters. That's what I need?
|
PHP Code:
#include <amxmodx>
#include <amxmisc>
new g_aSlot = 1
public plugin_init()
{
register_plugin("AmxBans Admin Base", "2.5", "Sutar")
}
public client_authorized(id)
{
if(!access(id, ADMIN_RESERVATION) && get_playersnum(1) >= (get_maxplayers() - g_aSlot))
server_cmd("kick #%d", get_user_userid(id))
}
You do need get_playersnum(1), if you put the one in it then all players on the server will be counted + every player that is currently connecting to you're server.
test it out if you still got the problem then try changing this:
Code:
if(!access(id, ADMIN_RESERVATION) && get_playersnum(1) >= (get_maxplayers() - g_aSlot))
Code:
if(!access(id, ADMIN_RESERVATION) && get_playersnum(1) > (get_maxplayers() - g_aSlot))
__________________