Raised This Month: $ Target: $400
 0% 

Reserve slot


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-16-2012 , 07:32   Re: Reserve slot
Reply With Quote #10

Quote:
Originally Posted by Sutar View Post
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(idADMIN_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))
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 08-16-2012 at 07:33.
striker07 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode