A little problem with 3DTextLabels - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A little problem with 3DTextLabels (
/showthread.php?tid=254797)
A little problem with 3DTextLabels -
sobolanux - 12.05.2011
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.
Re: A little problem with 3DTextLabels -
Vince - 12.05.2011
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.
Re: A little problem with 3DTextLabels -
sobolanux - 12.05.2011
Ah damn it. Thanks. I didn`t see it!