SetPlayerPos
From SA-MP Wiki
Set a player's position.
(playerid,Float:x,Float:y,Float:z)
| 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 |
| Returns | This function doesn't return a specific value |
// Teleports players to the center of San Andreas when they type /middle public OnPlayerCommandText(playerid,cmdtext[]) { if(!strcmp(cmdtext,"/middle",true)) { SetPlayerPos(playerid,0.0,0.0,3.0); return 1; } return 0; }
[edit]
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetPlayerPosFindZ: Set a player's position and find the ground.
- GetPlayerPos: Get a player's position.
- SetVehiclePos: Set the position of a vehicle.
- GetVehiclePos: Get the position of a vehicle.
