06.12.2014, 17:06
I wanted to check crashes with crashdetect plugin and it printed out something which im not sure how to fix..
It doesn't crash the player ingame, however i want to know why this is explained as a crash.
This is the code:
I made this code before sometime, it works great yet it outputing this crash detection?
It doesn't crash the player ingame, however i want to know why this is explained as a crash.
pawn Код:
[debug] AMX backtrace:
[debug] #0 00231924 in ?? (0, 6, 0) from RP.amx
[debug] #1 0000fa2c in public OnPlayerInteriorChange (0, 6, 0) from LG-RP.amx
[debug] Run time error 4: "Array index out of bounds"
[debug] Accessing element at negative index -100
pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
new string[100], idx = GetPlayerVirtualWorld(playerid)-100;
format(string, sizeof(string), bzPATH, idx); // Formats the File path
INI_ParseFile(string, "LoadBizStream_%s", .bExtra = true, .extra = idx); // Openes the file and loads everything in it. (initializing it)
if(BizInfo[idx][bStreamAble] == 1)
{
PlayAudioStreamForPlayer(playerid, BizInfo[idx][bStream]);
}
else
{
StopAudioStreamForPlayer(playerid);
}
foreach(Player, i)
{
if(GetPlayerState(i) == 9)
{
if(Specid[i] == playerid)
{
SetPlayerInterior(i, newinteriorid);
return 1;
}
}
}
return 1;
}


