SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 11/01/2018, 05:42 PM   #1
Huge Clucker
Manyula's Avatar
Join Date: Jan 2012
Location: Germany
Posts: 290
Reputation: 47
Default PlayerTextDraws: Best Practice

So, over the past few days, I've been trying to learn more about best practices concerning textdraws, per-player textdraws in particular. I've stumbled upon a few threads that discussed this exact issue which you can find here:I couldn't really find a satisfying answer, though. I'll try to break it down:

Do I need to use an array with PlayerTextDraws?
Some say it's needed because the order in which the textdraws are created matters, and IDs could get mixed up when you're not using an array. This, however, assumes that player textdraws are created when they're needed as opposed to creating them in bulk when a player connects and only showing and hiding them. At least that's how I understand it.
Others say it's not needed because there would be no point in having a 'playerid' parameter then. This assumes that you create all textdraws in bulk when a player connects and never destroy them. We're talking about a variable size reduction by the factor of MAX_PLAYERS, which is huge. This leads me to my next question...

When do I create/destroy textdraws?
Do I want to create them all at once and only show and hide them, or do I want to create them when they are needed and destroy them immediately when they are not needed anymore?
Manyula is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Decent GM for practice Mo123 Scripting Help 3 25/12/2017 04:44 AM
Q: Scripting practice Uberanwar Scripting Help 4 02/04/2016 05:34 PM
Just practice Razturach Scripting Help 6 01/12/2015 12:14 PM
[GameMode] DMP [Deathmatch Practice] RedFusion Gamemode Scripts 18 21/05/2014 02:32 PM
PlayerTextDraws Roko_foko Scripting Help 12 27/06/2012 11:16 PM

All times are GMT. The time now is 02:31 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.