SetPlayerWorldBounds

SetPlayerWorldBounds

Description:
Function SetPlayerWorldBounds set the world boundaries for a player. Players can not go out of the boundaries (they will be pushed back in).
This function does not work if used in OnPlayerConnect!
This function doesn't work in interiors!
A player's world boundaries can be reset by setting them to 20000.0000, -20000.0000, 20000.0000, -20000.0000. These are the default values.


Parameters:
(playerid,Float:x_max,Float:x_min,Float:y_max,Float:y_min)
{int {{{2}}} {{{3}}}

|playerid|The ID of the player to set the world boundaries of.}}

float x_max The maximum X coordinate the player can go to.
float x_min The minimum X coordinate the player can go to.
float y_max The maximum Y coordinate the player can go to.
float y_min The minimum Y coordinate the player can go to.


Return Values:
  • 1: The function was executed successfully.
  • 0: The function failed to execute. This means the player specified does not exist.


    (North)
                ymax
            |----------|
            |          |
(West) xmin |          | xmax (East)
            |          |
            |----------|
                ymin
               (South)
Examples:
public OnPlayerSpawn(playerid)
{
    SetPlayerWorldBounds(playerid, 20.0, 0.0, 20.0, 0.0);
    return 1;
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.