TextDrawDestroy (a workaround/upgrade?)
#4

Quote:
Originally Posted by Y_Less
View Post
No, what you're saying is that SA-MP should write an intelligent server than can guess when you've made a mistake in your code and correct it for you automatically. As far as the server is concerned you created one text draw then destroyed it - it is doing EXACTLY what you told it to and there are NO bugs here! A better idea is to properly test your code and remove any bugs, especially as there is no guarantee that ANY TD will be TD zero if say a filterscript has already made one, so you have no way of knowing in advance whether to use your "Ex" function or not.

Here is a better idea: Don't initialise all your variables to a valid Text Draw ID, set them to -1 instead!
Or... SAMP team just makes it so ID 0 isn't deleted when it's not the intended target, whether either (ID '0' or the intended target) exists or not.



Quote:
Originally Posted by Tee
View Post
If the textdraw ID is more than 0 that means it HAS to be created therefore it does take into consideration that textdraws that haven't been created, can't be deleted.
Textdraw variables aren't set to 0 when a textdraw is destroyed.

pawn Code:
new Text:text=TextDrawCreate(0,0," "); //ID 5, for example's sake
TextDrawDestroy(text); //ID 5 Destroyed
printf("%d",_:text); //Still prints 5, so...
TextDrawDestroy(text); //attempts to destroy ID 5 again
Reply


Messages In This Thread
TextDrawDestroy (a workaround/upgrade?) - by Tee - 10.07.2012, 18:21
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 10.07.2012, 18:55
Re: TextDrawDestroy (a workaround/upgrade?) - by Tee - 10.07.2012, 19:05
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 10.07.2012, 19:06
Re: TextDrawDestroy (a workaround/upgrade?) - by Tee - 10.07.2012, 19:07
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 10.07.2012, 19:17
Re: TextDrawDestroy (a workaround/upgrade?) - by Tee - 10.07.2012, 19:21
Re: TextDrawDestroy (a workaround/upgrade?) - by Jay_ - 10.07.2012, 19:36
Re: TextDrawDestroy (a workaround/upgrade?) - by Y_Less - 10.07.2012, 19:52
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 10.07.2012, 20:03
Re: TextDrawDestroy (a workaround/upgrade?) - by MP2 - 10.07.2012, 20:25
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 10.07.2012, 20:47
Re: TextDrawDestroy (a workaround/upgrade?) - by MP2 - 10.07.2012, 20:49
Re: TextDrawDestroy (a workaround/upgrade?) - by Y_Less - 10.07.2012, 20:50
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 10.07.2012, 21:22
Re: TextDrawDestroy (a workaround/upgrade?) - by Y_Less - 10.07.2012, 21:39
Re: TextDrawDestroy (a workaround/upgrade?) - by MP2 - 10.07.2012, 21:53
Re: TextDrawDestroy (a workaround/upgrade?) - by Jay_ - 10.07.2012, 22:36
Re: TextDrawDestroy (a workaround/upgrade?) - by Tee - 10.07.2012, 22:57
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 10.07.2012, 23:10
Re: TextDrawDestroy (a workaround/upgrade?) - by Kar - 11.07.2012, 00:47
Re: TextDrawDestroy (a workaround/upgrade?) - by Roko_foko - 11.07.2012, 07:01
Re: TextDrawDestroy (a workaround/upgrade?) - by Joe Staff - 11.07.2012, 07:37
Re: TextDrawDestroy (a workaround/upgrade?) - by MP2 - 11.07.2012, 07:39
Re: TextDrawDestroy (a workaround/upgrade?) - by Slice - 11.07.2012, 08:36
Re: TextDrawDestroy (a workaround/upgrade?) - by MP2 - 11.07.2012, 09:10
Re: TextDrawDestroy (a workaround/upgrade?) - by Y_Less - 11.07.2012, 11:16
Re: TextDrawDestroy (a workaround/upgrade?) - by MP2 - 11.07.2012, 12:18
Re: TextDrawDestroy (a workaround/upgrade?) - by MP2 - 12.07.2012, 12:50
Re: TextDrawDestroy (a workaround/upgrade?) - by Y_Less - 12.07.2012, 13:10
Re: TextDrawDestroy (a workaround/upgrade?) - by Slice - 12.07.2012, 13:16
Re: TextDrawDestroy (a workaround/upgrade?) - by Y_Less - 12.07.2012, 13:19
Re: TextDrawDestroy (a workaround/upgrade?) - by Patrik356b - 22.07.2012, 14:13
Re: TextDrawDestroy (a workaround/upgrade?) - by [HLF]Southclaw - 22.07.2012, 20:25

Forum Jump:


Users browsing this thread: 2 Guest(s)