[HLF]Southclaw
Unregistered
Ok, I have a textdraw with a Number of players array on it:
new Text
Text[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
Posts: 15,941
Threads: 0
Joined: Jun 2008
Quote:
Originally Posted by [ЉǾǖŦĦЗŁΛẄ
~ [HellFire] ]
new Text Text[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.
[HLF]Southclaw
Unregistered
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