Question for arrays
#1

Do I have to annul all arrays when the player connects?
example:
I have added on top of the script: new AdminDuty[MAX_PLAYERS] = 0;
Do I have to write AdminDuty[playerid] = 0; in public OnPlayerConnect If I want each player has AdminDuty[playerid] = 0, when connect to the server?
Reply
#2

Depends if that player is not previously registered.

To be honest, You shouldn't declare ANY enums until that player has "Registered / Logged" into the server.

Once they FIRST register...
You should set all enums for that player

so "AdminDuty[playerid] = 0;"
would be set when they first register
Then
When they login, It should just call previously saved data.
Reply
#3

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)