Values being set to 0? -
BigGroter - 10.09.2013
pawn Код:
cache_get_row(i, 0, String);
houseInfo[i][houseID] = strval(String);
I then use it to create an object, but when I try to edit the object, the houseID is 0?
pawn Код:
EditDynamicObject(playerid, houseInfo[id][houseID]);
new string[128];
format(string, sizeof(string), "ID: %d"houseInfo[id][houseID])
SCM(playerid, 0, string);
It always sends 0, why?
Re: Values being set to 0? -
sleepysnowflake - 10.09.2013
pawn Код:
format(string, sizeof(string), "ID: %d", houseInfo[id][houseID])
you forgot a little ',' over there
Re: Values being set to 0? -
NoahF - 10.09.2013
SCM(playerid, -0, string);
You need to put -0. Not sure if this will fix it!
Re: Values being set to 0? -
doreto - 10.09.2013
Quote:
Originally Posted by NoahF
SCM(playerid, -0, string);
You need to put -0. Not sure if this will fix it!
|
There is nothing to do with code as SCM (stand from SendClientMessage) only show message in-game and doesn't do anything to code, also 0 is black color and -1 is white.
Re: Values being set to 0? -
BigGroter - 10.09.2013
@Berlovan: That was just a fail when typing the text on here lol, it's not like that in the script so the issue persists.
Re: Values being set to 0? -
Konstantinos - 10.09.2013
Does MySQL load them correctly?
Re: Values being set to 0? -
BigGroter - 10.09.2013
Adding
pawn Код:
printf("ID: %d", houseInfo[id][houseID]);
after loading just prints 1, 2 ,3 etc. Their real houseIDs in the database are 7, 8, 9 etc. So I guess not. :S
edit: Actually, it's messing up the IDs at the CreateDynamicObject line, why is this?
Re: Values being set to 0? -
Konstantinos - 11.09.2013
Well, it makes no sense.
The houseids should be in order. Either by starting 0, 1, 2 ... or by starting 1, 2, 3 ... (using auto increment).
Re: Values being set to 0? -
BigGroter - 11.09.2013
Added a new variable, houseInfo[MAX_HOUSES][object];
houseInfo[i][object] = CreateDynamicObject(2332, houseInfo[i][CoX],houseInfo[i][CoY],houseInfo[i][CoZ]-0.2,0,0,0);
However, when I try to move the object using a command, it says that [object] is 0? When I assign it it's 1+.
Re: Values being set to 0? -
Konstantinos - 11.09.2013
Hold on. At your first post, what it gave you the value 0 was
houseInfo[id][houseID].
If you want to move/edit an object, then you use
houseInfo[id][object] instead.