SA-MP Forums Archive
Must be assigned to an array - 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: Must be assigned to an array (/showthread.php?tid=289457)



Must be assigned to an array - Shuffler - 11.10.2011

pawn Код:
CMD:factionname(playerid, params[])
{
    new string[128];
    if(PVar[playerid][pFaction] == 0)
    {
        return SendClientMessage(playerid, COLOR_RED, "[ERROR:] You are not in a faction");
    }
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USE: /factionname [name]");
    format(string, sizeof(string), "[INFO:] You have set factions name to %s", params);
    SendClientMessage(playerid, COLOR_GREEN, string);
    new factionid;
    factionid = PVar[playerid][pFaction];
    return FVar[factionid][fName] = params; // Says that this must be assigned to an array
}
Any help?


Re: Must be assigned to an array - IstuntmanI - 11.10.2011

fName must to be a string, if it is, try this:
Код:
format( FVar[ factionid ][ fName ], "%s", params );



Re: Must be assigned to an array - Wesley221 - 11.10.2011

Is the 'fName' in the enum a string? If not:
pawn Код:
fName[50]
Should be in the enum like that