SetPlayerWorldBounds

From SA-MP Wiki

Jump to: navigation, search


Description:

Set the world boundaries for a player. Players can not go out of the boundaries (they will be pushed back in).


Parameters:
(playerid,Float:x_max,Float:x_min,Float:y_max,Float:y_min)
playeridThe ID of the player to set the world boundaries of.
Float:x_maxThe maximum X coordinate the player can go to.
Float:x_minThe minimum X coordinate the player can go to.
Float:y_maxThe maximum Y coordinate the player can go to.
Float:y_minThe minimum Y coordinate the player can go to.


Return Values:

This function does not return any specific values.


Image:32px-Circle-style-warning.png

Important
Note

This function does not work if used in OnPlayerConnect


Image:32px-Ambox_warning_orange.png

Note

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.


Image:32px-Circle-style-warning.png

Important
Note

This function doesn't work in interiors!


               (North)
                ymax
            |----------|
            |          |
(West) xmin |          | xmax (East)
            |          |
            |----------|
                ymin
               (South)

Example Usage:

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.

Personal tools
Navigation
Toolbox
In other languages