Setting world boundaries?
#1

Hey there,

I have been recently working on a gamemode that also limits access outside LV. But I have no idea how do I set the world boundaries of that location, so I can block anyone from leaving.


Any suggestions?
Reply
#2

Make a Timer that ticks ever 3-5 seconds,and it checks the player location,if the play location is outside your boundries,reset his location back to where you want
Reply
#3

https://sampwiki.blast.hk/wiki/SetPlayerWorldBounds
Reply
#4

pawn Code:
/*
                •• /save // max

         ymax
     |----------|
     |          |
xmin |          | xmax
     |          |
     |----------|
         ymin

     • /save // min
*/
When you press Esc > map and map icon is facing up, then you're on the correct angle. Go to the left and down (see the single •) and save with name // min, then go to the right and up (see double • (••)) and save with name //max

Go to ducoments > gta sa user files > samp > savedpositions.txt, go to the bottom and copy the X, Y parameters.

Let's say, these are the positions
Code:
AddPlayerClass(2,1546.3549,-1675.5996,13.5622,89.0421,0,0,0,0,0,0); // min
AddStaticVehicle(411,4041.7681,-508.6000,1.4601,340.5664,177,215); // max
and the parameters are: x_max, x_min, Y_max, y_min so it will looks like: 4041.7681, 1546.3549, -508.6000, -1675.5996

pawn Code:
// Result:
SetPlayerWorldBounds(playerid, 4041.7681, 1546.3549, -508.6000, -1675.5996);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)