SA-MP Forums Archive
error 033: array must be indexed (variable "scorevariable") - 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: error 033: array must be indexed (variable "scorevariable") (/showthread.php?tid=537526)



error 033: array must be indexed (variable "scorevariable") - Type-R - 16.09.2014

Hi i have ran into a problem where i get this error, and dont seem to know a way how to fix it. Heres the script:

pawn Код:
if(dialogid == 20009)
    {
        if(response)
        {
        if(listitem == 0)
   {
    new Cache:result = mysql_query(mysql, "SELECT Vardas,Nuzudymai FROM vartotojai ORDER BY Nuzudymai DESC LIMIT 10");


    new
    ID,
    output[812];

    for(new i, j = 10; i < j; i++) // loop through all the rows that were found
    {
   
        ID ++;
       
        new
            username[24],
            scorevariable[10];
           
        cache_get_field_content(i, "Vardas", username, mysql, 129);
        scorevariable = cache_get_row_int(i, 0, mysql); //line of error
        format(output, sizeof(output), "{9999CC}%s%d. {96CBCB}%s {9999CC}» {C0C0C0}%d {9999CC}nuzudymai.\n", output, ID, username);//, strval(scorevariable));
    }
    cache_delete(result);

    ShowPlayerDialog(playerid, 822, DIALOG_STYLE_MSGBOX, "{A3E4FF}Top 10", output, "Gerai", "");

       }
Do you guys know what the problem with this is?


Re: error 033: array must be indexed (variable "scorevariable") - Flake. - 16.09.2014

You should have it in your player enum

scorevariable[MAX_PLAYERS]

scorevariable[playerid] = blah blah