Array must be indexed
#1

pawn Код:
new Model;
new Color1;
new Color2;
new Price;
new Buyable;
pawn Код:
if(dialogid == 1)
    {
        if(response)
        {
            ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Car Factory","Choose the model of your vehicle:","Continue","");
            Model = inputtext;
        }
        if(!response)
        {
            SendClientMessage(playerid,-1,"{FF0000}.: Cancelled :.");
        }
    }
    if(dialogid == 2)
    {
        if(response)
        {
            ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Car Factory","Pickup the first color you wish:","Continue","");
            Color1 = inputtext;
        }
        if(!response)
        {
            SendClientMessage(playerid,-1,"{FF0000}.: Cancelled :.");
        }
    }
    if(dialogid == 3)
    {
        if(response)
        {
            ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"Car Factory","Pickup the second color you wish:","Continue","");
            Color2 = inputtext;
        }
        if(!response)
        {
            SendClientMessage(playerid,-1,"{FF0000}.: Cancelled :.");
        }
    }
    if(dialogid == 4)
    {
        if(response)
        {
            ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Car Factory","How much will the car cost?","Continue","");
            Price = inputtext;
        }
        if(!response)
        {
            SendClientMessage(playerid,-1,"{FF0000}.: Cancelled :.");
        }
    }
    if(dialogid == 5)
    {
        if(response)
        {
            ShowPlayerDialog(playerid,6,DIALOG_STYLE_INPUT,"Car Factory","Will the car be buyable? (1 = Yes, 0 = No)","Continue","");
            Buyable = inputtext;
        }
        if(!response)
        {
            SendClientMessage(playerid,-1,"{FF0000}.: Cancelled :.");
        }
    }
Код:
error 006: must be assigned to an array
error 006: must be assigned to an array
error 006: must be assigned to an array
error 006: must be assigned to an array
error 006: must be assigned to an array
Reply
#2

With that code you store a string inside an integer, a string of characters is a 1 dimension vector with a size "X" that holds the ammount of characters you input, which is also known as an array.

So if i did not missunderstand your code, it should be

new Model[SIZE];

and same with the rest, SIZE is a number, choose it yourself.
Reply
#3

I already tried that and I get this errors:
Код:
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
error 035: argument type mismatch (argument 1)
error 033: array must be indexed (variable "Model")
error 033: array must be indexed (variable "Color1")
error 033: array must be indexed (variable "Color2")
error 033: array must be indexed (variable "Price")
error 033: array must be indexed (variable "Buyable")
Reply
#4

BumP
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)