World Bounds - 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: World Bounds (
/showthread.php?tid=399595)
World Bounds -
JaKe Elite - 15.12.2012
I'm creating a world bounds system to avoid the player escaping the TDM Gameplay area.
However it doesn't work. So i used gangzones to get the maxx, maxy, minx, miny.
It still don't work.
It's very simple. I want to create a square area.
Las Venturas (Default Spawn of blank.amx) to Caligulas Casino.
Code:
Note: I even try SetPlayerWorldBounds but didn't work.
pawn Код:
public IsInBounds()
{
for(new i; i < MAX_SLOTS; i++)
{
if(IsPlayerConnected(i))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(i, X, Y, Z);
if(!(X <= 1930.159423 && X >= 1351.851684 && Y <= 2184.662597 && Y >= 1754.383666)) return 1;
else
{
SetPlayerHealth(i, 0.0);
GameTextForPlayer(i, "~w~Stay in the ~r~gameplay ~w~bounds!", 1000, 5);
}
}
}
return 1;
}
Even if i remove the ! in the (X. Still doesn't work. Even i change the code except the maxx, maxy, minx, miny. It doesn't work.
AW: World Bounds -
Kevin54321 - 15.12.2012
Hello

1. Delete the '!'.
2. How is MAX_SLOTS defined?
Re: World Bounds -
Lordzy - 15.12.2012
I hope this works fine and it will also help you:
https://sampwiki.blast.hk/wiki/Areacheck