debug problem
#1

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;

}
Reply


Messages In This Thread
debug problem - by Walkie - 01.02.2014, 21:00
Re: debug problem - by Konstantinos - 01.02.2014, 21:45
Re: debug problem - by Walkie - 01.02.2014, 21:51
Re: debug problem - by Konstantinos - 01.02.2014, 22:16
Re: debug problem - by Walkie - 02.02.2014, 06:58
Re: debug problem - by Konstantinos - 02.02.2014, 09:33
Re: debug problem - by Misiur - 02.02.2014, 11:30

Forum Jump:


Users browsing this thread: 2 Guest(s)