Full server but players can still connect
#1

I have kind of a strange problem. When my server is full with 32 players sometimes a few more players will join with ids 32, 33, even as high as 34 so that we have 35/32 slots used. I tried adding
Код:
public OnPlayerConnect(playerid)
{
	if(playerid > (MAX_PLAYERS-1)) return Kick(playerid);
but it has no effect. How do I prevent this? My server is still on 0.3.7 because my host is slow to update.
Reply
#2

Do you use a VPS, dede or host. Post which and what company
Reply
#3

Evolution Host. Not VPS or dedicated, just game server hosting.
Reply
#4

You're using NPCs? I had got the same problem a time ago, I think that is caused by FNPC plugin.

I have solved the problem with that:
pawn Код:
public OnIncomingConnection(playerid, ip_address[], port)
{
    if(!IsPlayerNPC(playerid) && playerid > MAX_PLAYERS-1) {
        Kick(playerid);
        BlockIpAddress(ip_address, 5000);
    }
    return 1;
}
Reply
#5

No NPCs. I will try to stop the connections in OnIncomingConnection.
Reply
#6

Quote:
Originally Posted by mooman
Посмотреть сообщение
No NPCs. I will try to stop the connections in OnIncomingConnection.
Worked? Else, game servers are usually behind the real time for like 3 mins, when a players logs out, the host should automatically put one slots free less, but it needs some time.
Reply
#7

Quote:
Originally Posted by mooman
Посмотреть сообщение
No NPCs. I will try to stop the connections in OnIncomingConnection.
So probably is a problem on SA-MP.
I think the code on Incoming Connection will solve that for you.
Reply
#8

I would recommend asking your host to update your server to R2-1. What operating system are they running?
Reply
#9

I'm back to report that connork's code worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)