SA-MP Forums Archive
Desync / Mysql Errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Desync / Mysql Errors (/showthread.php?tid=591371)



Desync / Mysql Errors - Nin9r - 11.10.2015

Hi there!

I have some problems with my server.

1. GM debug:

Код:
[13:08:08] [debug] Run time error 4: "Array index out of bounds"
[13:08:08] [debug]  Accessing element at index 65535 past array upper bound 999
[13:08:08] [debug] AMX backtrace:
[13:08:08] [debug] #0 0019d5ec in public globalPlayerLoop () at D:\server\gamemodes\vortex.pwn:28768
28768 line:
Код:
if(PlayerFind[x] != 999)
.

2. Mysql Error:

Код:
[16:08:16] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
and
Код:
[17:10:16] [ERROR] CMySQLQuery::Execute - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1
[17:10:16] [WARNING] cache_get_row_count - no active cache
[17:10:16] [WARNING] CMySQLHandle::DeleteSavedResult - invalid result id ('0')
3. Desync problem. When i have more than 35 players online, they will not see the textdraws, moneybar is not working properly and some players will have desyncronization. I don't know why.. And if i will be in a area with a lot of players we will have a high ping. Some reasons for that? ( i have defined maX_players to 1000 in a_samp.inc, not in gm)

Please, help me.


Re: Desync / Mysql Errors - AbyssMorgan - 11.10.2015

PHP код:
//more ?
if(PlayerFind[x] != 999)
//more ? 



Re: Desync / Mysql Errors - Nin9r - 11.10.2015

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
//more ?
if(PlayerFind[x] != 999)
//more ? 
Код:
if(FindTime[x] == 1)
		{
			if(PlayerFind[x] != 999)
			{
				new target;
	            target = PlayerFind[x];
		        if(InBizz[target] != 0)
		        {
		            CP[x] = 385;
	    	    PlayerData[x][pCheckpoint] = 0;
		        	SetPlayerCheckpoint(x, businessVariables[InBizz[target]][bExteriorPos][0], businessVariables[InBizz[tinta]][bExteriorPos][1], businessVariables[InBizz[target]][bExteriorPos][2], 7);
		        }
		        if(InHouse[target] != 0)
		        {
		            CP[x] = 385;
	    	    PlayerData[x][pCheckpoint] = 0;
		        	SetPlayerCheckpoint(x, houseVariables[InHouse[target]][hHouseExteriorPos][0], houseVariables[InHouse[target]][hHouseExteriorPos][1], houseVariables[InHouse[target]][hHouseExteriorPos][2], 7);
		        }
		        if(InHQ[target] != 0)
		        {
		            CP[x] = 385;
	    	    PlayerData[x][pCheckpoint] = 0;
		        	SetPlayerCheckpoint(x, groupVariables[InHQ[target]][gGroupExteriorPos][0], groupVariables[InHQ[target]][gGroupExteriorPos][1], groupVariables[InHQ[target]][gGroupExteriorPos][2], 7);
		        }
		        if(InHQ[target] != 0 && InHouse[target] != 0 && InBizz[target] != 0)
		        {
		        	new Float: xf, Float: y, Float: z;
		       		GetPlayerPos(target,xf,y,z);
		        	SetPlayerCheckpoint(x,xf,y,z,3.0);
		        	InHQ[target] = 0;
		        	InHouse[target] = 0;
		        	InBizz[target] = 0;
		        	CP[x] = 385;
	    	    PlayerData[x][pCheckpoint] = 0;
		        }
			}
		}



Re: Desync / Mysql Errors - AbyssMorgan - 11.10.2015

what values can take 'x'


Re: Desync / Mysql Errors - Vince - 11.10.2015

"index 65535" is nearly always caused by not properly checking the input value for INVALID_PLAYER_ID or INVALID_VEHICLE_ID before using the value in an array. Most notably in OnPlayerDeath.

Furtherore, using 999, 255, -1 or any other arbitrary value to indicate an invalid value is bad practice. Even more so since 999 can in fact be a valid playerid. Always use INVALID_PLAYER_ID or INVALID_VEHICLE_ID where appropriate.


Re: Desync / Mysql Errors - Nin9r - 11.10.2015

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
what values can take 'x'
A player id. Actually, i am using x like foreach(Player , x).


Re: Desync / Mysql Errors - Nin9r - 15.10.2015

BUMP


Re: Desync / Mysql Errors - Nin9r - 24.10.2015

BUMP


Re: Desync / Mysql Errors - Danzou - 24.10.2015

Sorry was seeing three topics with the same subject Mysql, and ended up putting the wrong subject.


Re: Desync / Mysql Errors - Nin9r - 24.10.2015

Quote:
Originally Posted by Danzou
Посмотреть сообщение
libmysql.dll
What does it mean?
I must to use libmysql.so plugin?