14.06.2018, 21:42
If you want to use that array per player to store 5 objects each per player:
When player 3 uses this command, the server will have the value "3" for the "playerid" variable and will simply use it as a reference to access the array.
So it will create all 5 objects for player 3 in this array as if you had typed this:
The same will happen for player 27.
The server will simply paste "27" as the first index of the array.
Code:
new objects[MAX_PLAYERS][5]; cmd:object(playerid, params[]) { objects[playerid][0] = createplayerobjectxxx objects[playerid][1] = createplayerobjectxxx objects[playerid][2] = createplayerobjectxxx objects[playerid][3] = createplayerobjectxxx objects[playerid][4] = createplayerobjectxxx return 1; }
So it will create all 5 objects for player 3 in this array as if you had typed this:
Code:
new objects[MAX_PLAYERS][5]; cmd:object(playerid, params[]) { objects[3][0] = createplayerobjectxxx objects[3][1] = createplayerobjectxxx objects[3][2] = createplayerobjectxxx objects[3][3] = createplayerobjectxxx objects[3][4] = createplayerobjectxxx return 1; }
The server will simply paste "27" as the first index of the array.