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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Must be assigned to an array. (/showthread.php?tid=200537)



Must be assigned to an array. - jameskmonger - 18.12.2010

pawn Код:
else if(dialogid == 4) {
        if(!response) {
            SendClientMessage(playerid, COLOR_RED, "You must register.");
            Kick(playerid);
        }
        format(string, sizeof(string), "Immigration Officer: Ah, you speak with an %s accent!", strpack(string2, inputtext));
        SendClientMessage(playerid, COLOR_WHITE, string);
        pInfo[playerid][Accent] = string2; //Line 351
        dini_IntSet(fileLoc, "Accent", string2); //Line 352
    }
Here's my error:
Quote:

C:\Users\James\Desktop\SAMP\gamemodes\roleplay.pwn (351) : error 006: must be assigned to an array
C:\Users\James\Desktop\SAMP\gamemodes\roleplay.pwn (352) : error 035: argument type mismatch (argument 3)




Re: Must be assigned to an array. - JaTochNietDan - 18.12.2010

Are you initializing pInfo[playerid][Accent] and string2 as an array?


Re: Must be assigned to an array. - jameskmonger - 18.12.2010

pawn Код:
enum playerData {
    Level,
    Experience,
    WS1,
    WS1Ammo,
    WS2,
    WS2Ammo,
    WS3,
    WS3Ammo,
    spawnX,
    spawnY,
    spawnZ,
    Registered,
    Age,
    Sex,
    Accent,
    Step
}
new pInfo[MAX_PLAYERS][playerData];
and
pawn Код:
new string2[128];