SA-MP Forums Archive
array must be indexed (variable "FactionInfo") - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: array must be indexed (variable "FactionInfo") (/showthread.php?tid=532775)



array must be indexed (variable "FactionInfo") - EmilLykke - 20.08.2014

Any ideas how to fix this problem?

pawn Код:
if(FactionInfo[VehicleInfo[i][vFaction]] == PlayerInfo[playerid][pFaction])



Re: array must be indexed (variable "FactionInfo") - Threshold - 20.08.2014

Show your FactionInfo enum/array/variable real quick?


Re: array must be indexed (variable "FactionInfo") - EmilLykke - 20.08.2014

It's easy to explain I think, all I need to know is the proper sentence...

I want it to be a frespawn command, so it goes like this

pawn Код:
COMMAND:frespawn(playerid, params[])
{
    if(PlayerInfo[playerid][pRank] >= 12)
    {
        if(IsPlayerInAnyFaction(playerid))
        {
            new string[256];
            format(string, sizeof(string), "%s has respawned all unused faction vehicles.");
            SendMessageToSameFaction(string, COLOR_GREY);
            for(new i; i != MAX_VEHICLES; i++)
            {
                new model = GetVehicleModel(i);
                if(CheckVehicleForPassengers(i) == -1 && model != 569 && model != 570 && model != 590 && model != 537 && model != 538)
                {
                    if(FactionInfo[PlayerInfo[playerid][pFaction]][pFaction] == PlayerInfo[playerid][pFaction])
                    {
                        Delete3DTextLabel(veicolo_callsign_testo[i]);
                        DestroyDynamicObject(VehicleInfo[i][vSiren]);
                        SetVehicleDead(i, 1);
                    }
                }
            }
        }
        else return SendClientMessage(playerid, COLOR_GREY, "You must be in a faction to perform this command.");
    }
    SendClientMessage(playerid, COLOR_GREY, "You need to be a high command in order to perform this command.");
    return 1;
}
But the line I send you above it broken.


Re: array must be indexed (variable "FactionInfo") - EmilLykke - 20.08.2014

I am confused about this.