Question
#1

Hi , I've just been thinking to myself about something.

And want to ask a question.

Is it bad to have lots of variables ?
Like [MAX_PLAYERS]; or just normal ones. Basically for checking things like for example if a gate is open.

I really want to know if it's alright to keep using lots of variables. Or is there something else I could try ?
But if variables are fine i'd just like that answer. If not , another way(if it's bad).

Like these for example are all used for a minigame I made

pawn Код:
new InGangWar[MAX_PLAYERS];
new bool:Gateopen;
new ggate;
new gTeam[MAX_PLAYERS];
new SwitchTeam[MAX_PLAYERS];
new Exited[MAX_PLAYERS];
Thanks
Reply
#2

Its ok if you use some variables but dont use for example 500-1000 variables.

EDIT: Take 3 reputation from me for asking questions.
Reply
#3

If you run into memory issues, you can always use PVars. I guess it's OK to use lots if you redefine MAX_PLAYERS to something smaller.
Reply
#4

And try to optimize it, as example use bitarrays for flags (false / true)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)