10.07.2012, 19:36
Sorry but this thread is retarded. How is the server supposed to know whether you're intending to delete textdraw ID 0 intentionally or not?
If you go back to some of the original topics that were created during the SA-MP 0.2 pre-release scripting builds (i.e. when textdraws were first introduced) they explain how to create/destroy and properly initialize variables for textdraws.
It is common sense when you think about it...
If you go back to some of the original topics that were created during the SA-MP 0.2 pre-release scripting builds (i.e. when textdraws were first introduced) they explain how to create/destroy and properly initialize variables for textdraws.
Code:
new Text:PlayerSpeedoDisplay[MAX_PLAYERS] = {Text:INVALID_TEXT_DRAW, ...}; initSpeedo(playerid) { // The texdraw already exists for this playerid index if(PlayerSpeedoDisplay[playerid] != Text:INVALID_TEXT_DRAW) { return; } PlayerSpeedoDisplay[playerid] = TextDrawCreate(...); } destroySpeedo(playerid) { // No textdraw exists for this playerid index if(PlayerSpeedoDisplay[playerid] == Text:INVALID_TEXT_DRAW) { return; } TextDrawDestroy(PlayerSpeedoDisplay[playerid]); PlayerSpeedoDisplay[playerid] = Text:INVALID_TEXT_DRAW; }