01.02.2014, 21:00
pawn Код:
[00:03:41] [debug] AMX backtrace:
[00:03:41] [debug] #0 0012351c in public IsLaw (playerid=0) at C:\Users\Filip\Desktop\SAMP 0.3Z\TRUNK\payphone\rp.pwn:22291
[00:03:41] [debug] #1 000cf3a0 in public OPJV_OnPlayerKeyStateChange (playerid=0, newkeys=0, oldkeys=4) at C:\Users\Filip\Desktop\SAMP 0.3Z\TRUNK\payphone\rp.pwn:12857
[00:03:41] [debug] #2 0000d454 in public OnPlayerKeyStateChange (playerid=0, newkeys=0, oldkeys=4) at C:\Users\Filip\Desktop\SAMP 0.3Z\pawno\include\opjv.inc:85
[00:03:43] [debug] Run time error 4: "Array index out of bounds"
pawn Код:
public IsLaw(playerid)
{
//22291 new slot = GetFactionSlot(CharacterInfo[playerid][active_character[playerid]][cFaction]);
if(slot > -1)
{
if(FactionInfo[slot][fType] == FAC_TYPE_LAW) { return true; } else { return false; }
}
return false;
}
pawn Код:
public GetFactionSlot(factionid)
{
for(new i = 0; i < MAX_FACTIONS; i ++)
{
if(FactionInfo[i][fID] == factionid) { return i; }
}
return -1;
}