Error with ID 301+ (server force acc to registration)
#1

Hi, i have big problem with my script.

Please, don't say me that my max_players is not on 500, because it is, it is everywhere on 500 (in gamemode, junkbuster, server.cfg...).

The problem is next: Server works perfect, without lags, but when id 301 and + (300 works great = thats 301 players online, 0+300) tries to connect, script automaticly set user variable gPlayerAccount[playerid] = 0; (not found acc) and send user to a registration process.

Also, server gives random colors to nicknames on TAB for ID 301+. (exc: purple, blue, red, green...)

I have no idea what's going on, I tried 100 things to solve this annoying problem! :@

Please, help if you know ! Thanks!
Reply
#2

The most likely cause of this issue is a buffer over/underflow in your script. For example, You may have an array with an index size defined at 300, and are trying to set the value of an index larger than 300 (i.e. representing the player's ID) to a value.

Code:
new bool:is_player_logged_in[300];

public OnPlayerConnect(playerid)
{
    // If player connects with an ID larger or equal to 300 an overflow will occur
    is_player_logged_in[ playerid ] = false;
}
The best way to trace buffer overflows is to look up the crash detect plugin. You can set an option in your server.cfg called die_on_error which the plugin will recognise. This will cause the server to exit when a runtime error or buffer overflow like this occurs. Whilst this approach may at first be extreme for a server that has 300 players connected to it, it's an effective method of eventually digging out all potential overflow issues. Alternatively, you could run unit tests or use resources like NPCs to simulate players.
Reply
#3

Quote:
Originally Posted by Jay_
View Post
Code:
new bool:is_player_logged_in[300];

public OnPlayerConnect(playerid)
{
    // If player connects with an ID larger or equal to 300 an overflow will occur
    is_player_logged_in[ playerid ] = false;
}
I don't have anything simular like that in my script, i have gActivePlayers[playerid]++; in onplayerconnect, but that's defined like new gActivePlayers[MAX_PLAYERS];

:S
Reply
#4

Even so you should load crashdetect plugin because it's very useful and it might give something related to your problem.

It can be found: https://github.com/Zeex/samp-plugin-...ases/tag/v4.12
Reply
#5

it still can't work .. Everything is okay but if there is some problems around login or saving .. If there is some problem it woldn't save lower player id's accont
Reply
#6

Is your database allowing more than a 300 player entry? You are pointing out that it forces people to re-registrar.
Reply
#7

read the second started theme..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)