12.05.2011, 19:57
Hi there. I`m currently working on a property system and I have a little problem. Everything works fine, except the creation of the Labels.
Here`s my function for data initalization (mysql based). I checked the bInfo and the variables are loaded from the database, but the Labels don`t show.
So, if I use Create3DTextLabel, the Label isn`t created generally for every player? And even if a play connects after the function has been called, he can still see the Label?
PS: My function is called only once, under OnGameModeInit() callback.
Here`s my function for data initalization (mysql based). I checked the bInfo and the variables are loaded from the database, but the Labels don`t show.
Код:
public InitProperties() { //conn mysql_connect(HOST, USER, DATABASE, PASSWORD); //get max id new Query[128] = "SELECT MAX(ID) FROM properties"; mysql_query(Query); Query = " "; mysql_store_result(); new Result[128]; mysql_fetch_row_format(Result, " "); mysql_free_result(); bMaxNumber = strval(Result); Result = " "; //create properties for(new i=1; i<=bMaxNumber; i++) { //query format(Query, sizeof(Query), "SELECT * FROM properties WHERE ID = %i", i); mysql_query(Query); mysql_store_result(); mysql_fetch_row_format(Result, " "); //var selection sscanf(Result, "p<|>is[128]fff", bInfo[i][ID], bInfo[i][bName], bInfo[i][bX], bInfo[i][bY], bInfo[i][bZ]); // unsynced var init bInfo[i][bIsShown] = 1; //free result mysql_free_result(); //create 3Dtext Create3DTextLabel(bInfo[i][bName], COLOR_GREEN, bInfo[i][bX], bInfo[i][bY], bInfo[i][bZ], 30, 0, 1); } //close conn mysql_close(); }
PS: My function is called only once, under OnGameModeInit() callback.