Weird problem
#1

Hi.

After running my CnR server for a while now, I noticed that peoples can't join if there are more than 3 players. I mean, when a 4th player join the server he can't login in/register and only werid black box will appear on screen. In console it says: Run time error 20: "Invalid index parameter (bad entry point). It's spamming this message whenever a 4th player trying to join in. (sleep mode).

What could be a problem ? I'm not using any FS and i have all plugins loaded well. main () {} are used in gamemode
Reply
#2

main( ) { }

Are you using this under includes and above defines?
Reply
#3

I have this in logs.

Код:
[12:21:08] [debug] Run time error 4: "Array index out of bounds"
[12:21:08] [debug] AMX backtrace:
[12:21:08] [debug] #0 000b213c in public Dialog_OnPlayerConnect (3) from CnR.amx
[12:21:08] [debug] #1 0004abd4 in public TIMER_OnPlayerConnect (3) from CnR.amx
[12:21:08] [debug] #2 native CallLocalFunction () from samp-server.exe
[12:21:08] [debug] #3 00048264 in public SSCANF_OnPlayerConnect (3) from CnR.amx
[12:21:08] [debug] #4 native CallLocalFunction () from samp-server.exe
[12:21:08] [debug] #5 00038a9c in public _y_utils_OnPlayerConnect (3) from CnR.amx
[12:21:08] [debug] #6 0000b028 in ?? (3, 1, 0, 0, 4, 3, 0, 0, 0, 0, ... <1073741813 arguments>) from CnR.amx
[12:21:08] [debug] #7 00010364 in public OnPlayerConnect (3) from CnR.amx
[12:21:38] [debug] Run time error 4: "Array index out of bounds"
[12:21:38] [debug] AMX backtrace:
[12:21:38] [debug] #0 000b7e84 in public Dialog_OnPlayerDisconnect (3, 1) from CnR.amx
[12:21:38] [debug] #1 0004ada0 in public TIMER_OnPlayerDisconnect (3, 1) from CnR.amx
[12:21:38] [debug] #2 native CallLocalFunction () from samp-server.exe
[12:21:38] [debug] #3 000482e4 in public ppb_OnPlayerDisconnect (3, 1) from CnR.amx
[12:21:38] [debug] #4 00046054 in public SSCANF_OnPlayerDisconnect (3, 1) from CnR.amx
[12:21:38] [debug] #5 native CallLocalFunction () from samp-server.exe
[12:21:38] [debug] #6 00038b20 in public _y_utils_OnPlayerDisconnect (3, 1) from CnR.amx
[12:21:38] [debug] #7 0000b098 in ?? (3, 1, 1, 0, 0, 8, 3, 1, 0, 0, ... <1073741813 arguments>) from CnR.amx
[12:21:38] [debug] #8 00010428 in public OnPlayerDisconnect (3, 1) from CnR.amx
Reply
#4

check the folder, you're missing some file.
Reply
#5

What files, all files i needed was created in scriptfiles 'Accounts' and i updated all includes/plugins and YSI to 4.0. Could you explain more ?
Reply
#6

[12:21:08] [debug] Run time error 4: "Array index out of bounds"
[12:21:08] [debug] AMX backtrace:
[12:21:08] [debug] #0 000b213c in public Dialog_OnPlayerConnect (3) from CnR.amx

Clearly, you are accessing an array index outside the bounds of your array. Show us the relevant function (Dialog_OnPlayerConnect).
Reply
#7

Код:
public OnPlayerConnect(playerid)
{
	new string[330];
	format(string, sizeof(string), "%s  joined the server.", GetName(playerid));
	SCMToAll(-1, string);

    AdminDuty[playerid] = 0;
    CountDeaths[playerid] = 0;
	StartDeathTick[playerid] = 0;
    PInfo[playerid][Cash] = 0;
    PInfo[playerid][Score] = 0;
	PInfo[playerid][Kills] = 0;
	PInfo[playerid][Deaths] = 0;
	
	RemoveBuilding(playerid);

 	new path[32], ip[16];

	GetPlayerIp(playerid, ip, sizeof(ip));

	format(path, sizeof(path), "/Banned/%s.ini", ip);

	if(fexist(UserPath(playerid)))
	{
	    new b_string[ 330 ];
		INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);

		if (PInfo[playerid][pBanned])
		{
		    format(b_string, sizeof(b_string), ""COL_WHITE"You are banned from this server.");
			ShowPlayerDialog(playerid, D_BANNED, DIALOG_STYLE_MSGBOX, "Acc", b_string, "Close", "");
			Kick(playerid);
  		}
  		else
  		{
			format(string, sizeof(string), "Welcome to Hunud CnR Server.\nYou are already registered.", GetName(playerid));
        	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Exit");
   		}
	}
	else
	{
    	new r_string[ 180 ];
		format(r_string, sizeof(r_string), "Welcome to Hunud CnR Server.\nYou are not registered.", GetName(playerid));
        ShowPlayerDialog(playerid, D_REGISTER, DIALOG_STYLE_PASSWORD, "Register", r_string, "Register", "Exit");
	}
	
    //--------------//
    for (new i; i < sizeof(AnimationLibraries); i++)
	{
        ApplyAnimation(playerid, AnimationLibraries[i], "null", 0.0, 0, 0, 0, 0, 0);
    }

	TimeCount[playerid] = SetTimerEx ("TotalPlay", 2000, true, "d", playerid);
	OPAC[playerid] = SetTimerEx("AntiC", 4500, true, "i", playerid);
	return 1;
}
Reply
#8

I just want to say, It's just showing when there are 4 or more players connected.
Reply
#9

new path[32] increase this numbers and try with it.
Код HTML:
 (for example new path[32+MAX_PLAYER_NAME];)
Reply
#10

Same problem.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)