Help /arrest
#1

Hello..I maked one prison with cells ,commands,/enter,/exit but i have problem with /arrest ..How can i make this

I arrest someone and then put random in cells..How to along select one koordinatz..I have 20 and more cells..

I can put /arrest here ..

Sry for my bad english im from croatia
Reply
#2

First, store the cell coordinates in an array (add your own coordinates):
pawn Код:
new Float:cells[][3] = {
{ 200.0, 13.45, 1.45 },
{ 210.0, 17.45, 1.45 },
{ 200.0, 18.45, 2.85 }
};
Then where you have to put the player in prison, use this code:
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
Reply
#3

Thanks so mach my brother LOCK
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)