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



Error 006: must be assigned to an array - sapsap - 24.03.2011

Hey, I got a prob. Errors like always.

Errors: Error 006: must be assigned to an array

Lines:
pawn Код:
if(strcmp(cmd, "/atmtransfer", true) == 0 || strcmp(cmd, "/atmwiretransfer", true) == 0)
    {
        if(IsPlayerConnected(playerid))
       {
            if(PlayerInfo[playerid][pLevel] < 3)
            {
                SendClientMessage(playerid, COLOR_GRAD1, " Du musst mindestens Level 3 sein !");
                return 1;
            }
            if(!AtATM(playerid))
            {
                    SendClientMessage(playerid, COLOR_GREY, "Du bist nicht an einem ATM !");
                        return 1;
                }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /atmtransfer [spielerid/name] [betrag]");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            giveplayerid = ReturnUser(tmp); // This is the Line
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Benutze: /atmtransfer [spielerid/name] [betrag]");
                return 1;
            }
            moneys = strval(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
              if(giveplayerid != INVALID_PLAYER_ID)
                {
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    playermoney = PlayerInfo[playerid][pAccount] ;
                    if (moneys > 0 && playermoney >= moneys)
                    {
                        PlayerInfo[playerid][pAccount] -= moneys;
                        PlayerInfo[giveplayerid][pAccount] += moneys;
                        format(string, sizeof(string), "Du hast %d$ auf %s's Konto ьberwiesen.", moneys, giveplayer,giveplayerid);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        SendClientMessage(playerid, COLOR_GRAD1, string);
                        format(string, sizeof(string), "Du hast %d$ auf dein Konto von %s ьberwiesen bekommen.", moneys, sendername);
                        SendClientMessage(giveplayerid, COLOR_GRAD1, string);
                        format(string, sizeof(string), "%s hat %d$ an %s ьberwiesen.", sendername, moneys, giveplayer);
                        if(moneys >= 500000)
                        {
                            ABroadCast(COLOR_YELLOW,string,1);
                        }
                        PayLog(string);
                        PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, " Ungьltiger Betrag.");
                    }

                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Du bist nicht beim ATM");
                }
                }
                else
                {
                    format(string, sizeof(string), "   %d ist kein aktiver Spieler.", giveplayerid);
                    SendClientMessage(playerid, COLOR_GRAD1, string);
                }
            }
            return 1;
        }



Re: Error 006: must be assigned to an array - Biesmen - 24.03.2011

Hm, for ReturnUser you do not need an array.
Are you sure tmp is defined with an array? An array is the number of cells for a variable.


Re: Error 006: must be assigned to an array - sapsap - 24.03.2011

I'm a little nooby now xD What do you mean with "length"?


Re: Error 006: must be assigned to an array - Biesmen - 24.03.2011

Length?

An array is something like this.
pawn Код:
new Array[cells];
So, is your TMP defined with an array?:
pawn Код:
new tmp[cells];
"Cells" should be a number.


Re: Error 006: must be assigned to an array - sapsap - 24.03.2011

Yep:

pawn Код:
new tmp[2599];



Re: Error 006: must be assigned to an array - Biesmen - 24.03.2011

2599?

Try to replace it with 256.

pawn Код:
new tmp[256];



Re: Error 006: must be assigned to an array - sapsap - 24.03.2011

Nopes not working...