Question about efficiency [I hail ye might y_less!]
#1

Ok, I have a textdraw with a Number of players array on it:

new TextText[PLAYERS]; // PLAYERS is my predefined number for max players on my server [to avoid looping 500]

And I create this textdraw when a player connects [applying the [ ] to their playerid] I was thinking would it by more efficient to create the text on OnGameModeInit and just loop 10 so 10 get created at startup?

Thanks
Reply
#2

Quote:
Originally Posted by [ЉǾǖŦĦЗŁΛẄ
~ [HellFire] ]
new TextText[PLAYERS]; // PLAYERS is my predefined number for max players on my server [to avoid looping 500]
That's what foreach is for.

Quote:
Originally Posted by [ЉǾǖŦĦЗŁΛẄ
~ [HellFire] ]
And I create this textdraw when a player connects [applying the [ ] to their playerid] I was thinking would it by more efficient to create the text on OnGameModeInit and just loop 10 so 10 get created at startup?
Depends what is in them - if there are only 10 and they have static text there's not point creating one per player. If they are different for each player then you need one each - it's not a question of efficiency, it's a question of what they're used for.
Reply
#3

It's to display what XP they get when they get a certain kill or action, so it has to be dynamic as 2 players could get a kill at the same time.

Thanks for reply
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)