30.11.2014, 15:57
What you are doing is creating a new array. MAX_PLAYERS is a standard defined value of 500. To change this you can put this on top of your script:
The number in between the brackets -> [] determines the size of the array when it is being created.
So now it would say Hitman[500], which means you have 500 "slots" available to save information. MAX_PLAYERS is used because you want to save a value for each player.
After an array is made you can read/write it by putting a index between the brackets.
So if you want to get the value of the 3rd spot in the array, you would use Hitman[2] (since arrays start at 0).
You could use this as the following (example):
https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays for more information
Код:
#undef MAX_PLAYERS #define MAX_PLAYERS 50 // For example, change 50 to what you want.
So now it would say Hitman[500], which means you have 500 "slots" available to save information. MAX_PLAYERS is used because you want to save a value for each player.
After an array is made you can read/write it by putting a index between the brackets.
So if you want to get the value of the 3rd spot in the array, you would use Hitman[2] (since arrays start at 0).
You could use this as the following (example):
Код:
new IsLoggedIn[MAX_PLAYERS]; if (IsLoggedIn[playerid] == 0) { // Player is not logged in } else if (IsLoggedIn[playerid] == 1) { // Player is logged in }