SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/06/2015, 12:28 PM   #1
DusanInfinity
Big Clucker
 
Join Date: Jun 2015
Location: Serbia
Posts: 122
Reputation: 0
Default Question for arrays

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?
__________________
DusanInfinity is offline   Reply With Quote
Old 26/06/2015, 12:34 PM   #2
Prokill911
Huge Clucker
 
Join Date: Jan 2015
Posts: 228
Reputation: 17
Default Re: Question for arrays

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.
Prokill911 is offline   Reply With Quote
Old 26/06/2015, 02:10 PM   #3
DusanInfinity
Big Clucker
 
Join Date: Jun 2015
Location: Serbia
Posts: 122
Reputation: 0
Default Re: Question for arrays

Thank you!
__________________
DusanInfinity is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about arrays? AndySedeyn Scripting Help 7 12/10/2014 08:35 AM
Arrays question PaulDinam Scripting Help 3 21/03/2013 05:37 PM
Arrays question! Kush Scripting Help 4 09/09/2012 07:10 PM
[Question] Arrays ArTisT Help Archive 1 20/06/2010 06:44 PM
Question about arrays Outbreak Help Archive 5 23/04/2009 10:56 PM


All times are GMT. The time now is 02:52 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.