SetPlayerPosFindZ

SetPlayerPosFindZ

Description:
Function SetPlayerPosFindZ this sets the players position then adjusts the players z-coordinate to the nearest solid ground under the position.
This function does not work if the new coordinates are far away from where the player currently is. The Z height will be 0, which will likely put them underground. It is highly recommended that the MapAndreas plugin be used instead.


Parameters:
(playerid, Float:x, Float:y, Float:z)
int playerid The ID of the player to set the position of.
float X The X coordinate to position the player at.
float Y The Y coordinate to position the player at.
float Z The Z coordinate to position the player at.


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


Examples:
SetPlayerPosFindZ(playerid, 1234.5, 1234.5, 1000.0);


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


Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
  • OnPlayerClickMap: Called when a player sets a waypoint/target on the pause menu map.