Help /arrest - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help /arrest (
/showthread.php?tid=294111)
Help /arrest -
Danchy - 31.10.2011
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
Re: Help /arrest -
KoczkaHUN - 31.10.2011
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
Re: Help /arrest -
Danchy - 31.10.2011
Thanks so mach my brother

LOCK