Quote:
Originally Posted by Richie
After some time now it bugs into my /stats td, funny thing when i /stats it is showing correctly and when textdraw is closed(TextDrawDestroy) and i do adminduty, the Textdraw shows in the area where statsTD is supposed to be with wrong font :S
|
Have you tried hiding the textdraw before destroying it? Sometime it helps sometime it doesn't. Some other things to look out for, if you are creating per player textdraws make sure you are setting all the array values to INVALID_TEXT_DRAW for example.....
Код:
new Text:somevar[MAX_PLAYERS] = {Text:INVALID_TEXT_DRAW, ...};
Doing that above to make sure all the array values are set to INVALID_TEXT_DRAW otherwise you would only set index 0 to invalid. If you are constantly creating and destroying textdraws do checks like this....
Код:
if(somevar[playerid] == Text:INVALID_TEXT_DRAW)
{
//Create the textdraw
}
When it comes time to destroy....
Код:
if(somevar[playerid] != Text:INVALID_TEXT_DRAW)
{
TextDrawHideForPlayer(playerid, somevar[playerid]);
TextDrawDestroy(somevar[playerid]);
}
Handling your text draws like so does reduce the amount of bugs, however as I stated before it still can mix together and at this time I feel like its more on samp's end. In 0.2x when we had to do TextDrawShow... after TextDrawSetString this problem did not seem to exist at least not that I remember....