A bit more flexible PlayerWorldBounds? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A bit more flexible PlayerWorldBounds? (
/showthread.php?tid=190144)
A bit more flexible PlayerWorldBounds? -
AirGuy92 - 14.11.2010
Is there a way to set more flexible worldbounds, like if you don't just want your world to be a square/rectangle ?
Just to show you what I mean:
Код:
___________________
|oooooooooooooooooo|___________
|ooooooooooooooooooooooooooooo|
|__ ooooooooooooo_____________|
|ooooooo _____|
|ooooooo|
|_______|
Could you create something like this?
Re: A bit more flexible PlayerWorldBounds? -
The_Moddler - 14.11.2010
Neh, it's impossible.. or maybe creating rectangle areas with IsPlayerInArea.
Re: A bit more flexible PlayerWorldBounds? -
Hiddos - 14.11.2010
It is possible, you'll just need to use IsPlayerInArea a few more times then normal
Re: A bit more flexible PlayerWorldBounds? -
DeathOnaStick - 14.11.2010
It's possible, just check if the player is in the area, like hiddos said.
In addition i made a totally useless example with a graphic that actually nobody will understand:
In this example you can
('t) see, that you just need to divide the area into some squares, like you also can
('t) see here (maybe here you can
('t) see it better than the last one):
For this example this pawn code could be used:
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (y<90 && y>75 && x<130 && x>100) //Player is in the first square
else //Player isn't in the first square
Then you just need to go on by adding more square and your area will be finished. If you want it to be exactly like worldbounds, you will need to use setplayervelocity, to push the player away from the border.
Re: A bit more flexible PlayerWorldBounds? -
AirGuy92 - 14.11.2010
Awesome! Thanks a lot guys!
Gonna try it out right now!