TextDrawDestroy (a workaround/upgrade?)
#8

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.

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;
}
It is common sense when you think about it...
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: 1 Guest(s)