Lost Conection to the Server Problem
#1

I have this problem a long time ago , but a few days appears very often.

Player get Lost Conection to The server and This server is restarting during the game .

I put crashdetect and i received it .
Код:
[15:52:32] [debug] Run time error 4: "Array index out of bounds"
[15:52:32] [debug]  Accessing element at index 750 past array upper bound 301
[15:52:32] [debug] AMX backtrace:
[15:52:32] [debug] #0 0002c754 in public SSCANF_OnPlayerDisconnect (playerid=74, reason=1) at gf.pwn:6625
[15:52:32] [debug] #1 native CallLocalFunction () [080dce40] from samp03svr
[15:52:32] [debug] #2 000031a8 in public Itter_OnPlayerDisconnect (playerid=74, reason=1) at pawno\include\sscanf2.inc:223
[15:52:32] [debug] #3 native CallLocalFunction () [080dce40] from samp03svr
[15:52:32] [debug] #4 00002820 in public OnPlayerDisconnect (playerid=74, reason=1) at pawno\include\foreach.inc:787
[15:52:32] [part] DrAcU.99 has left the server (74:1)
http://pastebin.com/PvnLPm5a - OnPlayerDisconnect .
This is line 6625 gLastDriver[gLastCar[playerid]] = 300;

I have latest includes.
Reply
#2

My guess is that you declared your gLastDriver array with the size of 300. Now, gLastCar[playerid] will store a vehicle ID, which obviously can go from 1 to 2000 (due to SA:MP limits). Increase your gLastDriver array size to 2000 instead of 300 and you should be fine.
Reply
#3

Change 300 to the amount of vehicles you have in your server.
If they're all static Copy + Paste the code into a new.pwn to count the number of lines,
Giving you the total number of vehicles. The string is too array size is too small which is why it's saying
It's out of bounds.
Reply
#4

I have dynamic system of private cars, do not have a fixed number of cars.

P.S : That would be a question for the player to receive Lost Conection to the server?

P.S2 : The problem with lostconection appears for each player and not always at different times !
Reply
#5

I'm guessing your enum looks something like;

pawn Код:
enum DynamicVehicles
{
   //Stuff here
};
new DV_Info[100][DynamicVehicles];
Change the 100 to the number of vehicles you are loading from the file their saved too.
For instance, if you're loading 200 vehicles change the 100 to 200.
It's out of bounds because you're loading more vehicles than are defined by your global definition.
Reply
#6

i have this:

Код:
new gLastDriver[302];
new gLastCar[301];
Код:
if (gLastCar[playerid] > 0)
	{
		gLastDriver[gLastCar[playerid]] = 300;// this is line with problem
		if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
		{
			gCarLock[gLastCar[playerid]] = 0;
		}
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)