Raised This Month: $12 Target: $400
 3% 

[CSGO] Client limiter


Post New Thread Reply   
 
Thread Tools Display Modes
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 06-15-2015 , 11:18   Re: [CSGO] Client limiter
Reply With Quote #21

Quote:
Originally Posted by asherkin View Post
You possibly want to be using GetMaxHumanPlayers() rather than the value of sv_visiblemaxplayers.

I've also removed the binary attachment since it compiles fine on the forum.
This. Can anyone maybe try this method? =D
I think that could solve my problem in the post above this.


Edit:
(psychonic): public bool OnClientConnect(int client, char[] rejectmsg, int maxlen) { if (GetClientCount() > GetMaxHumanPlayers()) { strcopy(rejectmsg, maxlen, "Server is full"); return false; } return true; }

Dont know how to add reserved slot into that. But Im no coder.

Last edited by Ejziponken; 06-15-2015 at 12:52.
Ejziponken is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 06-15-2015 , 20:03   Re: [CSGO] Client limiter
Reply With Quote #22

Quote:
Originally Posted by Ejziponken View Post
This part isn't really true? They CAN connect, but they get kicked after they connected.
Technically yes, they got kicked after 0.1 game time (based on a tickrate).

Quote:
Originally Posted by Ejziponken View Post
And thats kinda pain for the players. Isnt there a way to actually block them from connecting?
There is a way, you could do sth like

PHP Code:
public bool OnClientConnect(int clientchar[] rejectmsgint maxlen

    if(
GetClientCount(false) > limit)
    { 
        
strcopy(rejectmsgmaxlen"Server is full")
        return 
false         
    

    return 
true 

But I think you cannot do a test for reserved slot access in that case. You have to wait for OnClientPostAdminCheck() event, which happens after client has fully connected.
__________________
Wilczek is offline
irepz
Senior Member
Join Date: Mar 2013
Location: France
Old 06-21-2015 , 06:01   Re: [CSGO] Client limiter
Reply With Quote #23

Looks like it doesn't work for me for slot count :

- maxplayers (launchscript) 10
- sm_admin_slots 1
- sv_visiblemaxplayers 9
Always show 10 players. I've set the 2 cvars in server.Cfg maybe i should use another ?
__________________
irepz is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 06-21-2015 , 06:33   Re: [CSGO] Client limiter
Reply With Quote #24

After your server starts, please send a command sv_visiblemaxplayers (without any parameters) to your console. What does it return?
__________________
Wilczek is offline
irepz
Senior Member
Join Date: Mar 2013
Location: France
Old 06-21-2015 , 07:14   Re: [CSGO] Client limiter
Reply With Quote #25

"sv_visiblemaxplayers" = "10" ( def. "-1" ) - Overrides the max players reported to prospective clients
__________________
irepz is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 06-21-2015 , 10:07   Re: [CSGO] Client limiter
Reply With Quote #26

So, if you set "sv_visiblemaxplayers 9" in a server.cfg and you still get "sv_visiblemaxplayers" = "10" in a rcon query, then something overwrites that setting. Check your other configs or plugins maybe?
__________________
Wilczek is offline
irepz
Senior Member
Join Date: Mar 2013
Location: France
Old 06-21-2015 , 12:42   Re: [CSGO] Client limiter
Reply With Quote #27

my bad ... thanks !

So now, it returns me 9 but i always see 10 slots in server browser
__________________

Last edited by irepz; 06-21-2015 at 14:28.
irepz is offline
Wilczek
AlliedModders Donor
Join Date: Oct 2012
Location: Poland
Old 06-21-2015 , 16:23   Re: [CSGO] Client limiter
Reply With Quote #28

I've tried it on my server just now. I can easily set sv_visiblemaxplayers to 9 and it shows 0/9 in the server browser.
__________________
Wilczek is offline
Ejziponken
AlliedModders Donor
Join Date: Apr 2008
Old 06-29-2015 , 08:45   Re: [CSGO] Client limiter
Reply With Quote #29

Edit:

Seems like the first one or two lines in the admin_slots.txt is NOT working?

Can anyone confirm?

Using this model:

STEAM_1:0:1234567 // nickname1
STEAM_1:1:1234567 // nickname2
STEAM_1:0:1234569 // nickname3

Last edited by Ejziponken; 06-29-2015 at 11:07.
Ejziponken is offline
irepz
Senior Member
Join Date: Mar 2013
Location: France
Old 08-05-2015 , 03:18   Re: [CSGO] Client limiter
Reply With Quote #30

Plugins randomly don't load with following errors :

L 08/05/2015 - 09:14:46: [SM] Native "IsEndOfFile" reported: invalid handle 0 (error: 4)
L 08/05/2015 - 09:14:46: [SM] Displaying call stack trace for plugin "clientlimiter.smx":
L 08/05/2015 - 09:14:46: [SM] [0] Line 113, /home/forums/content/files/2/0/6/4/9/6/145352.attach::LoadSteamIDList()
L 08/05/2015 - 09:14:46: [SM] [1] Line 25, /home/forums/content/files/2/0/6/4/9/6/145352.attach::OnPluginStart()
__________________
irepz is offline
Reply


Thread Tools
Display Modes

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 22:25.


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