Text draws.
#1

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
Reply
#2

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)