SA-MP Forums Archive
Text draws. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Text draws. (/showthread.php?tid=349189)



[SOLVED] Text draws - CLOSED - swindle69 - 08.06.2012

Hello im having a few issues with text draws.

I would post the full code but its pretty straight forward.

I just have two public functions calling information from a database and then displaying the results in a text draw.

These public functions are on a timer (every 3 seconds).

Everything compiles fine but when i connect to the server i see the two text draws constantly flashing. Its as if the TextDrawDestroy() is killing both public functions.

Hes one example of my public functions.

Код:
public GPS(playerid)
{
new zone[MAX_ZONE_NAME], Text:GPS_UPDATE, textbox_gps[128], query[300], zone_speed[128];

GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);

format(query, sizeof(query), "SELECT * FROM zone_speeds WHERE location_name='%s'", zone);

mysql_query(query);

mysql_store_result();

while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(zone_speed, "zonespeed");
}
format(textbox_gps, sizeof(textbox_gps), "Location: %s SPEED: %s", zone, zone_speed);
TextDrawDestroy(Text:GPS_UPDATE);
GPS_UPDATE = TextDrawCreate(5.0, 428.0, textbox_gps);
TextDrawUseBox(GPS_UPDATE, 0);
TextDrawShowForPlayer(playerid, GPS_UPDATE);
return true;
}
So im worndering if theres something better then TextDrawDestroy? like a TextDrawupdate?
or
am i going about this all wrong?

Thanks for any feedback! + Rep etc


Re: Text draws. - Gaetic - 08.06.2012

I don't know if there's a function like this or not. This might you.


Re: Text draws. - swindle69 - 08.06.2012

Okay well after having a break. i now have worked out why i was having these issues..

The fix is you cant have two public functions with textdraws.. it leads to problems.. The fix is to turn one to a global Text:Vaule. Witch did the trick for me.

Thanks Gaetic for your input ill send you a +rep.