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, 04:42 PM   #1
Manyula
Huge Clucker
 
Join Date: Jan 2012
Location: Germany
Posts: 282
Reputation: 43
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 03:44 AM
Q: Scripting practice Uberanwar Scripting Help 4 02/04/2016 04:34 PM
Just practice Razturach Scripting Help 6 01/12/2015 11:14 AM
[GameMode] DMP [Deathmatch Practice] RedFusion Gamemode Scripts 18 21/05/2014 01:32 PM
PlayerTextDraws Roko_foko Scripting Help 12 27/06/2012 10:16 PM


All times are GMT. The time now is 05:21 AM.


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