31.10.2011, 11:32
First, store the cell coordinates in an array (add your own coordinates):
Then where you have to put the player in prison, use this code:
pawn Код:
new Float:cells[][3] = {
{ 200.0, 13.45, 1.45 },
{ 210.0, 17.45, 1.45 },
{ 200.0, 18.45, 2.85 }
};
pawn Код:
new cell_id = random(sizeof cells); // this will calculate a random cell, and store it in variable cell_id
SetPlayerPos(playerid, cells[cell_id][0], cells[cell_id][1], cells[cell_id][2]); // this will put the player in the coordinates of the random cell