A little problem with 3DTextLabels
#1

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.

Код:
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();
}
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.
Reply
#2

You're fetching the row with a space as a delimiter and then you're trying to split the line with the pipe symbol as a delimiter.
Reply
#3

Ah damn it. Thanks. I didn`t see it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)