28.08.2013, 18:26
How to make when player use command, to get on map random checkpoints ?
new
Float: checkpoints[ ][ 3 ] =
{
{ 0.0, 0.0, 0.0 },
{ 10.0, 10.0, 10.0 },
{ 20.0, 20.0, 20.0 },
{ 30.0, 30.0, 30.0 },
{ 40.0, 40.0, 40.0 }
}
;
CMD:rcp( playerid, params[ ] )
{
new
rand = random( sizeof( checkpoints ) )
;
SetPlayerCheckpoint( playerid, checkpoints[ rand ][ 0 ], checkpoints[ rand ][ 1 ], checkpoints[ rand ][ 2 ], 3.0 );
return 1;
}
public OnPlayerEnterCheckpoint( playerid )
{
new
rand = random( sizeof( checkpoints ) )
;
SetPlayerCheckpoint( playerid, checkpoints[ rand ][ 0 ], checkpoints[ rand ][ 1 ], checkpoints[ rand ][ 2 ], 3.0 );
return 1;
}
pawn Code:
|
new
Float: checkpoints[ ][ 3 ] =
{ // X Y Z put your coordinates according to the column.
{ 0.0, 0.0, 0.0 },
{ 10.0, 10.0, 10.0 },
{ 20.0, 20.0, 20.0 },
{ 30.0, 30.0, 30.0 },
{ 40.0, 40.0, 40.0 }
}
;