09.03.2014, 12:45
(
Последний раз редактировалось anou1; 09.03.2014 в 13:28.
)
Hi
So I tried to do what you told me and everything works EXCEPT for the 2 first ID's ( 0 and 1)
This is the code:
The part of my createhouse CMD:
But when I create a house, I got something like this:
House ID 0 have been created.
House ID 0 have been created.
House ID 1 have been created.
House ID 2 have been created.
House ID 3 have been created.
So the second house created always have id equal 0.
I'm still trying to correct this but I have no ideas right now.
Could somebody help me with this please ?
Thank you !
EDIT: I modified my cmd but it still the same,
So I tried to do what you told me and everything works EXCEPT for the 2 first ID's ( 0 and 1)
This is the code:
Код:
(( Top of my script I have new idMaison; ID_MAISON_INVALIDE is defined to 0)) stock GetNewHouseID() { new query[128]; mysql_format(mysql, query, sizeof(query), "SELECT * FROM `maisons`"); mysql_tquery(mysql, query, "OnGetHouseID", ""); return 1; } public OnGetHouseID() { new rows, fields, id; cache_get_data(rows, fields, mysql); if(rows) { id = cache_get_row_count(); printf("Il y a %d maison", cache_get_row_count()); idMaison = id; printf("Il y a dйjа des maison, le futur ID est: %d", id); return id; } id = ID_MAISON_INVALIDE; idMaison = id; return id; }
Код:
new id = GetNewHouseID(); mInfo[id][mWorld] = idMaison; format(string, sizeof(string), "La maison ID %d a bien йtй crйe.", mInfo[id][mWorld]); SendClientMessage(playerid, -1, string);
House ID 0 have been created.
House ID 0 have been created.
House ID 1 have been created.
House ID 2 have been created.
House ID 3 have been created.
So the second house created always have id equal 0.
I'm still trying to correct this but I have no ideas right now.
Could somebody help me with this please ?
Thank you !
EDIT: I modified my cmd but it still the same,
Код:
GetNewHouseID(); new id = idMaison;