Values being set to 0?
#1

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?
Reply
#2

pawn Код:
format(string, sizeof(string), "ID: %d", houseInfo[id][houseID])
you forgot a little ',' over there
Reply
#3

SCM(playerid, -0, string);
You need to put -0. Not sure if this will fix it!
Reply
#4

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

@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.
Reply
#6

Does MySQL load them correctly?
Reply
#7

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?
Reply
#8

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).
Reply
#9

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+.
Reply
#10

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


Forum Jump:


Users browsing this thread: 5 Guest(s)