World Bounds
#1

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

Hello
1. Delete the '!'.
2. How is MAX_SLOTS defined?
Reply
#3

I hope this works fine and it will also help you:
https://sampwiki.blast.hk/wiki/Areacheck
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)