error again -.- - 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 again -.- (
/showthread.php?tid=198625)
error again -.- -
MestreKiller - 12.12.2010
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 -.-
Re: error again -.- -
Joe_ - 12.12.2010
It says that 'Dini_Get(...)' must be assigned to a array, so assign it to a array not a varible, like you're doing.
Re: error again -.- -
MestreKiller - 12.12.2010
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 -.-
Re: error again -.- -
Joe_ - 12.12.2010
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 );
Re: error again -.- -
MestreKiller - 12.12.2010
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 -.-
Re: error again -.- -
Joe_ - 12.12.2010
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).
Re: error again -.- -
MestreKiller - 12.12.2010
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
Re: error again -.- -
Joe_ - 12.12.2010
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.
Re: error again -.- -
MestreKiller - 12.12.2010
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