PDA

View Full Version : Question


Hunud
09/02/2018, 03:17 PM
Hi,

Just a small question regrading to textdraws. Is there any diffrence if i loop tho textdraws even if i made them in a small amount or should i just repeat code 2-3 times (TextDrawShowForPlayer, etc). Any in what situation i can do loop ?

Gammix
09/02/2018, 03:26 PM
Well, if the number of textdraws can be changed, wheather in game by players or by users of the script; then you should use a loop.

For example, i made a server logo for my public script, i know when i release this script people might change the server logo, add or remove textdraws to my logo textdraw array. So i use loops to show and hide in the script. So i write a little note in my release thread that "if you want to change the logo, all you have to do is change array size and add textdraw code to it".

Hunud
09/02/2018, 03:34 PM
Well, if the number of textdraws can be changed, wheather in game by players or by users of the script; then you should use a loop.

For example, i made a server logo for my public script, i know when i release this script people might change the server logo, add or remove textdraws to my logo textdraw array. So i use loops to show and hide in the script. So i write a little note in my release thread that "if you want to change the logo, all you have to do is change array size and add textdraw code to it".

Oh that's awesome. But why many of the peoples think that it's bad to use loop just for few textdraws ?

What's the better for loop MAX_PLAYERS or GetPlayerPoolSize. T

Thanks

Gammix
09/02/2018, 03:38 PM
Oh that's awesome. But why many of the peoples think that it's bad to use loop just for few textdraws ?

What's the better for loop MAX_PLAYERS or GetPlayerPoolSize. T

Thanks
I gave you the reason for using loop, so next time some asks, you know what you're doing and can answer him why.

Well showing and hiding textdraws should use GetPlayerPoolSize since we only want to show to players connected right?!

Hunud
09/02/2018, 03:48 PM
Thanks a lot.

+Rep