error again -.-
#1

pawn Код:
stock LoadHouses()
{
    new housecount = 0;
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        new file[128];
        format(file, sizeof(file), "HouseSystem/Houses/%d.ini", i);
        if(dini_Exists(file))
        {
            PickupID[i] = CreatePickup(1273, 23, dini_Float(file, "HX"), dini_Float(file, "HY"), dini_Float(file, "HZ"), -1);
            HInfo[i][owned] = dini_Int(file, "Owned");
            HInfo[i][price] = dini_Int(file, "Price");
            HInfo[i][ownername] = dini_Get(file, "Ownername");
            housecount ++;
        }
    }
    printf("\n||-Houses loaded successfuly: %d-||\n",housecount);
    return 1;
}
pawn Код:
HInfo[i][ownername] = dini_Get(file, "Ownername");
Код:
C:\Users\User\Desktop\servers2\FC-RP\filterscripts\housesystem.pwn(114) : error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
1 Error.
i know im annoying -.-
Reply
#2

It says that 'Dini_Get(...)' must be assigned to a array, so assign it to a array not a varible, like you're doing.
Reply
#3

Quote:
Originally Posted by Joe_
Посмотреть сообщение
It says that 'Dini_Get(...)' must be assigned to a array, so assign it to a array not a varible, like you're doing.
im not understanding -.-
Reply
#4

You're assigning a string to a varible, which can only hold one value, and only integers.

You need to assign it to a array, which can hold multiple pieces of data.

And you cannot assign a string directly to a array / string, you must format it, or it'll bring up another error.


pawn Код:
// Array, with 24 cells, one cell can hold 1 piece of data, when assigning it traditionally, MAX_PLAYER_NAME is the same as 24 cells.
new
    gArray[ MAX_PLAYER_NAME ];

// Format the array, to hold what dini_Get (..) returns

format(gArray, sizeof( gArray ), "%s", dini_Get( file, "Ownername" ));

// gArray will now be the same as what dini_Get returned
// Now use gArray, which is the owners name.

printf( "The owners name is: %s", gArray );
Reply
#5

Quote:
Originally Posted by Joe_
Посмотреть сообщение
You're assigning a string to a varible, which can only hold one value, and only integers.

You need to assign it to a array, which can hold multiple pieces of data.

And you cannot assign a string directly to a array / string, you must format it, or it'll bring up another error.


pawn Код:
// Array, with 24 cells, one cell can hold 1 piece of data, when assigning it traditionally, MAX_PLAYER_NAME is the same as 24 cells.
new
    gArray[ MAX_PLAYER_NAME ];

// Format the array, to hold what dini_Get (..) returns

format(gArray, sizeof( gArray ), "%s", dini_Get( file, "Ownername" ));

// gArray will now be the same as what dini_Get returned
// Now use gArray, which is the owners name.

printf( "The owners name is: %s", gArray );
can you please transform that to my command please because i tryed it my slef but COME with the same error -.-
Reply
#6

I'm not here to script for you (or anybody), I'm telling you HOW and why you're getting the error, figure it out yourself.

I have no experience with dini, but I'm assuming it is returning a string, so you'll need to store the returned string into a string that has enough space (cells).
Reply
#7

Quote:
Originally Posted by Joe_
Посмотреть сообщение
I'm not here to script for you (or anybody), I'm telling you HOW and why you're getting the error, figure it out yourself.

I have no experience with dini, but I'm assuming it is returning a string, so you'll need to store the returned string into a string that has enough space (cells).
you sir are a complete idiot
Reply
#8

Thanks, I don't know what you are if I'm a complete idiot, is there a word for it?

This is what I get for trying to help, you can then do it yourself.
Reply
#9

Quote:
Originally Posted by Joe_
Посмотреть сообщение
Thanks, I don't know what you are if I'm a complete idiot, is there a word for it?

This is what I get for trying to help, you can then do it yourself.
well you didnt help on anything
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)