07.11.2013, 20:18
That would be one way using arrays
The other way would be using a switch statment and putting the cordinates in SetPlayerCheckpoint directly
pawn Код:
CreateRandomMissionCheckpoint(playerid, Float: size) {
static const
Float: sData[][] = {
{0.0, 1.0, 2.0},
{3.0, 4.0, 5.0}
};
new
rand = random(sizeof sData)
;
if(SetPlayerCheckpoint(playerid, sData[rand][0], sData[rand][1], sData[rand][2], size)) {
return rand;
}
return -1;
}