---
title: "SetPlayerPosFindZ | open.mp"
description: "This sets the players position then adjusts the players z-coordinate to the nearest solid ground under the position."
canonical: https://omp.itsneufox.com/docs/scripting/functions/SetPlayerPosFindZ
language: en
---

# SetPlayerPosFindZ

## Description

This sets the players position then adjusts the players z-coordinate to the nearest solid ground under the position.

| Name | Description |
| --- | --- |
| playerid | The ID of the player to set the position of. |
| Float:x | The X coordinate to position the player at. |
| Float:y | The X coordinate to position the player at. |
| Float:z | The Z coordinate to position the player at. |

## Returns

**true** - The function executed successfully.

**false** - The function failed to execute. This means the player specified does not exist.

## Examples

```c
SetPlayerPosFindZ(playerid, 1234.5, 1234.5, 1000.0);
```

## Notes

warning

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](https://github.com/philip1337/samp-plugin-mapandreas) or [ColAndreas](https://github.com/Pottus/ColAndreas) plugin be used instead.

## Related Functions

-   [SetPlayerPos](https://omp.itsneufox.com/docs/scripting/functions/SetPlayerPos): Set a player's position.

## Related Callbacks

-   [OnPlayerClickMap](https://omp.itsneufox.com/docs/scripting/callbacks/OnPlayerClickMap): Called when a player sets a waypoint/target on the pause menu map.
