HELP dialog login not show [Crash Detect]
#1

Delete Thx a lot
Reply
#2

[17:57:18] [debug] OnPlayerConnect(27)
[17:57:18] [debug] Run time error 4: "Array index out of bounds"
[17:57:18] [debug] Accessing element at index 27 past array upper bound 23

why OnPlayerConnect Max 23
Reply
#3

Post OnPlayerSpawn and MP_OPC.

There's an array that has been declared with size 24 (valid indexes 0-23). So the last valid index is 23 but it accessed the element at index 27 (in MP_OPC) and 26 (in OnPlayerSpawn).
Reply
#4

What is MP_OPC
Reply
#5

mSelection OPC // where i can edit array
Reply
#6

Use the Edit () button, double posting is not allowed.

Quote:
Originally Posted by bigtigerbeee
Посмотреть сообщение
What is MP_OPC
There's a public function in tolrp.pwn with the name MP_OPC (the plugin detected that it's caused from there). Do Ctrl + F and search for: MP_OPC
and post it with the OnPlayerSpawn callback too.

Quote:
Originally Posted by bigtigerbeee
Посмотреть сообщение
mSelection OPC // where i can edit array
I don't understand what you meant.
Reply
#7

Код:
MP_OPC It on inc mSelection 

public OnPlayerConnect(playerid)
{
	// Init all of the textdraw related globals
    gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    gCancelButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
    
    for(new x=0; x < mS_SELECTION_ITEMS; x++) {
        gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
	}
	
	gItemAt[playerid] = 0;
	
	return CallLocalFunction("MP_OPC", "i", playerid);
}
Sorry for double post
Reply
#8

Then post that MP_OPC public function from the include and OnPlayerSpawn.

The exact thing caused it is unknown:

#0 000dd6e8 in ??
#0 0001e480 in ??

But it may give more information if you compile with debug info.

Goto pawno folder and create a file pawn.cfg
Open it and write in it:
pawn Код:
-d3
Save it and re-compile your gamemode. Run the server again and wait for the next debug messages, post them and we'll see.
Reply
#9

Код:
#if defined _ALS_OnPlayerConnect
	#undef OnPlayerConnect
#else
	#define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect MP_OPC

forward MP_OPC(playerid);
and spawn

Код:
public OnPlayerSpawn(playerid) {
	#if defined DEBUG
	    printf("[debug] OnPlayerSpawn(%d)", playerid);
	#endif

/*	if (!IsPlayerNPC(playerid))
	{
		if(PlayerInfo[playerid][aAntiSpeedHack]!=2)
		{
			PlayerInfo[playerid][aAntiSpeedHack]=1;
		}
	}*/

	if(PlayerInfo[playerid][pStatus] == 0 && IsPlayerConnected(playerid))
	{
	    Kick(playerid);
	}

	for(new a=0; a < 129; a++) ApplyAnimation(playerid,AnimLibraies[a],"null",0.0,0,0,0,0,0);


	for(new i=0; i < sizeof(ZoneInfo); i++)
	{
	    GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(FamilyInfo[ZoneInfo[i][eOwnerid]][FamilyColor]));
	    if(ZoneAttacker[i] != -1) GangZoneFlashForPlayer(playerid, ZoneID[i], GetTeamZoneColor(FamilyInfo[ZoneAttacker[i]][FamilyColor]));
	}

	SetPlayerColor(playerid, COLOR_WHITE);
	SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]);
	//SetSafePlayerPos(playerid, 0, 0, 0);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 998);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 998);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 998); // Skilled, but not dual-wield.
    SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 0);
	ShowPlayerBar(playerid);
	if(PlayerInfo[playerid][pPrisonTime] >= 1) {
	    switch(PlayerInfo[playerid][pPrisonID]) {
			case 1: {
			    SetSafePlayerPos(playerid, -26.8721, 2320.9290, 24.3034);
				SetPlayerInterior(playerid, 0);
				SetPlayerVirtualWorld(playerid, 0);
			}
			case 2: {
				SetSafePlayerPos(playerid, 264.58, 77.38, 1001.04);
				SetPlayerInterior(playerid, 6);
				SetPlayerVirtualWorld(playerid, 0);
			}
			case 3: {

				if(PlayerInfo[playerid][pPrisonUse] == -1)
				{
	   				SetPlayerInterior(playerid, 1);
					SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+5);

					SetSafePlayerPos(playerid, -114.0368,1873.2427,1428.4781);
					SetPlayerFacingAngle(playerid, 0);
				    SendClientMessage(playerid, -1,"ЎГШіТаЕЧНЎЛйН§ўС§·ХиµйН§ЎТГЎиН№, гЄй /takejail");
				    SetPlayerSkin(playerid, 268);

				}
				else
				{
	   				SetPlayerInterior(playerid, 1);
					SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+5);
					new jailid = PlayerInfo[playerid][pPrisonUse];
					SetSafePlayerPos(playerid, JailInfo[jailid][jaiPos][0],JailInfo[jailid][jaiPos][1],JailInfo[jailid][jaiPos][2]);
					SetPlayerFacingAngle(playerid, 0);
					SetPlayerSkin(playerid, 268);

				}

/*				SetPlayerInterior(playerid, 0);
				SetPlayerVirtualWorld(playerid, 0);

				new spawn = random(sizeof(JailSpawns));

				SetSafePlayerPos(playerid, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
				SetPlayerFacingAngle(playerid, 0);*/
			}
		}
		return 1;
	}

	if(PlayerInfo[playerid][pTutorial] == 1) {
		SetPlayerInterior(playerid, 14);
		SetSafePlayerPos(playerid, 216.9770, -155.4791, 1000.5234);
		SetPlayerFacingAngle(playerid, 267.9681);
		TogglePlayerControllable(playerid, false);
		return 1;
	}
	if(FixDSpawn[playerid] == 0 && NewbieSpawn[playerid] == 0)
	{
		if(PlayerInfo[playerid][pDie] >= 1)
		{
			initiateDie(playerid);
			return 1;
	 	}

		if(PlayerInfo[playerid][pHospitalized] >= 1)
		{
			initiateHospital(playerid);
			return 1;
	 	}
	}
	SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
	SetSafePlayerPos(playerid, PlayerInfo[playerid][pPos][0], PlayerInfo[playerid][pPos][1], PlayerInfo[playerid][pPos][2]);
	SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
	SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
	PlayerTextDrawShow(playerid, SDPlace[playerid]);
	SetCameraBehindPlayer(playerid);
	PlayerInfo[playerid][pSkinSet] = 1;
	TextDrawShowForPlayer(playerid, SERVERNAME);
	ResetPlayerWeapons(playerid);
	//giveSaveWP(playerid);

	if(PlayerInfo[playerid][pEvent] >= 1)
		PlayerInfo[playerid][pEvent] = 0;

	if(PlayerInfo[playerid][pAdminDuty] == 1) {
		SetPlayerHealth(playerid, 500000.0);
	}
	else {
		SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
		SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
	}

	if(!GetPlayerInterior(playerid)) {
		SetPlayerWeather(playerid, weatherVariables[0]);
	}
	else {
		SetPlayerWeather(playerid, INTERIOR_WEATHER_ID);
	}

	syncPlayerTime(playerid);
	TogglePlayerControllable(playerid, true);

	return 1;
}
Reply
#10

To be honest, it's odd about OM_OPC (the hook of OnPlayerConnect). I'd guess that mS_SELECTION_ITEMS was defined as 24 but I cannot see any reason why it'd go to index 27 when it loops correctly.

Again, without lines the only thing we can do is guessing. I'll show what parts are suspicious and you can see the size of those arrays so you can help us to find it faster. The size of the array we're looking for is 24.

pawn Код:
for(new a=0; a < 129; a++) ApplyAnimation(playerid,AnimLibraies[a],"null",0.0,0,0,0,0,0);
Check AnimLibraies' size.

---

pawn Код:
for(new i=0; i < sizeof(ZoneInfo); i++)
    {
        GangZoneShowForPlayer(playerid, ZoneID[i], GetTeamZoneColor(FamilyInfo[ZoneInfo[i][eOwnerid]][FamilyColor]));
        if(ZoneAttacker[i] != -1) GangZoneFlashForPlayer(playerid, ZoneID[i], GetTeamZoneColor(FamilyInfo[ZoneAttacker[i]][FamilyColor]));
    }
Check FamilyInfo's size.

---

pawn Код:
new jailid = PlayerInfo[playerid][pPrisonUse];
                    SetSafePlayerPos(playerid, JailInfo[jailid][jaiPos][0],JailInfo[jailid][jaiPos][1],JailInfo[jailid][jaiPos][2]);
Check JailInfo's size.

---

Which one of those uses size of 24 at its declaration?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)