A bit more flexible PlayerWorldBounds?
#1

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?
Reply
#2

Neh, it's impossible.. or maybe creating rectangle areas with IsPlayerInArea.
Reply
#3

It is possible, you'll just need to use IsPlayerInArea a few more times then normal
Reply
#4

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.
Reply
#5

Awesome! Thanks a lot guys!
Gonna try it out right now!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)