01.02.2014, 21:45
It's caused because of active_character[playerid].
Let's say, you declared it as:
You need to check if active_character[playerid] is between 0-24. Change accordingly to the value of the dimension.
If IsLaw is not called by a timer or Call Remote/Local Function, then just use stock instead of forward/public.
pawn Код:
new slot = GetFactionSlot(CharacterInfo[playerid][active_character[playerid]][cFaction]);
pawn Код:
new CharacterInfo[MAX_PLAYERS][25][some_enum_here];
pawn Код:
public IsLaw(playerid)
{
if (0 <= active_character[playerid] < 25)
{
new slot = GetFactionSlot(CharacterInfo[playerid][active_character[playerid]][cFaction]);
if(slot > -1 && FactionInfo[slot][fType] == FAC_TYPE_LAW) return true;
}
return false;
}