Question
#1

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 ?
Reply
#2

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".
Reply
#3

Quote:
Originally Posted by Gammix
Посмотреть сообщение
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
Reply
#4

Quote:
Originally Posted by Hunud
Посмотреть сообщение
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?!
Reply
#5

Thanks a lot.

+Rep
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)