[Qestions]
#3

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:

Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 50 // For example, change 50 to what you want.
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):

Код:
new IsLoggedIn[MAX_PLAYERS];

if (IsLoggedIn[playerid] == 0)
{
 // Player is not logged in
}
else if (IsLoggedIn[playerid] == 1)
{
  // Player is logged in
}
https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays for more information
Reply


Messages In This Thread
[Qestions] - by astanalol00 - 30.11.2014, 15:48
Re: [Qestions] - by Abagail - 30.11.2014, 15:51
Re: [Qestions] - by AnthonyTimmers - 30.11.2014, 15:57
Re: [Qestions] - by astanalol00 - 30.11.2014, 16:10

Forum Jump:


Users browsing this thread: 1 Guest(s)