21.02.2015, 10:52
Hello guys, I was working on a race system and i wanted to make a dynamic system, i was wondering how to save checkpoints coords into a variable (multiple).
#define MAX_CHECKPOINTS 1337 // set this to your desired amount of max checkpoints.
enum E_CP_DATA
{
race_id, // ID of the race.
Float:cp_x, // x coordinate of the cp
Float:cp_y, // y coordinate of the cp
Float:cp_z // z coordinate of the cp
};
new gCheckpointCoords[ MAX_CHECKPOINTS ][ E_CP_DATA ];
gCheckpointCoords[ 0 ][ race_id ] = 0;
gCheckpointCoords[ 0 ][ cp_x ] = 13.37;
gCheckpointCoords[ 0 ][ cp_y ] = 1000.69;
gCheckpointCoords[ 0 ][ cp_z ] = 15134.1243;