Repeating Checkpoints
#1

Hello all, how I can make repeating checkpoint, such as I enter on the checkpoint and automatically appear another checkpoint. Sorry for my bad english.
Reply
#2

You need to use arrays; for example:
pawn Код:
enum CP_DATA
{
    Float: CP_X,
    Float: CP_Y,
    Float: CP_Z
};

new
    CP[ 50 ][ CP_DATA ],
    Player_CP[ MAX_PLAYERS ]
;

// OnGameModeInit: assign some coordinates to them.
// An example (random coordinates)
CP[ 0 ][ CP_X ] = 568.4641;
CP[ 0 ][ CP_Y ] = 688.4468;
CP[ 0 ][ CP_Z ] = 518.4441;

CP[ 1 ][ CP_X ] = 988.4641;
CP[ 1 ][ CP_Y ] = 641.4468;
CP[ 1 ][ CP_Z ] = 546.4441;

// OnPlayerConnect: reset it.
Player_CP[ playerid ] = -1;

// Where you set the FIRST checkpoint:
Player_CP[ playerid ] = 0;

// OnPlayerEnterRaceCheckpoint (I guess for racing system)
Player_CP[ playerid ]++;
new
    cp = Player_CP[ playerid ]
;
SetPlayerRaceCheckpoint( playerid, CP[ cp ][ CP_X ], CP[ cp ][ CP_Y ], CP[ cp ][ CP_Z ], CP[ cp ][ CP_X + 1 ], CP[ cp ][ CP_Y + 1 ], CP[ cp ][ CP_Z + 1 ], 9 );
This is just an example, if you want for a racing system, you will need to add another array that stores the raceid.

Anyways, you got an idea.
Reply
#3

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)