Error 006: must be assigned to an array
#1

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;
        }
Reply
#2

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.
Reply
#3

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

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.
Reply
#5

Yep:

pawn Код:
new tmp[2599];
Reply
#6

2599?

Try to replace it with 256.

pawn Код:
new tmp[256];
Reply
#7

Nopes not working...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)