How to make a checkpoint that doesn't show on the map??
#4

pawn Код:
enum CP_INFO {
    bool:set = false,
    Float:x,
    Float:y,
    Float:z,
    Float:size
};

#define CHECKPOINT_STREAMER_DISTANCE 200.0

new Checkpoints [ 500 ] [ CP_INFO ];

stock AddCheckpoint ( Float:cord_x, Float:cord_y, Float:cord_z, Float:cp_size ) {
    for ( new i; i < sizeof ( Checkpoints ); i++ ) {
        if ( Checkpoints [ i ] [ set ] == true && i == ( sizeof ( Checkpoints ) - 1 ) ) return 0;
        if ( Checkpoints [ i ] [ set ] == true ) continue;
       
        Checkpoints [ i ] [ x ] = cord_x;
        Checkpoints [ i ] [ y ] = cord_y;
        Checkpoints [ i ] [ z ] = cord_z;
        Checkpoints [ i ] [ size ] = cp_size;
    }
    return 1;
}
// AddCheckpoint
// return -->
// 1 -> successfully
// 0 -> problem

public OnPlayerUpdate ( playerid ) {
    for ( new i; i < sizeof ( Checkpoints ); i++ ) {
        if ( Checkpoints [ i ] [ set ] == false ) continue;
       
        if ( IsPlayerInRangeOfPoint ( playerid, CHECKPOINT_STREAMER_DISTANCE, Checkpoints [ i ] [ x ], Checkpoints [ i ] [ y ], Checkpoints [ i ] [ z ] ) ) {
            DisablePlayerCheckpoint ( playerid );
            SetPlayerCheckpoint ( playerid, Checkpoints [ i ] [ x ], Checkpoints [ i ] [ y ], Checkpoints [ i ] [ z ], Checkpoints [ i ] [ size ] );
        } else DisablePlayerCheckpoint ( playerid );
    }
    return 1;
}
i don't know if will work, test.
but you can use one checkpoint at CHECKPOINT_STREAMER_DISTANCE (range)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)