10.07.2012, 19:06
Quote:
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! |
Quote:
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.
|
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