SetPlayerPos

From SA-MP Wiki

(Redirected from Function:SetPlayerPos)
Jump to: navigation, search

SetPlayerPos


This function sets the players position to the specified co-ordinates.


Parameters:
(playerid,Float:x,Float:y,Float:z)
playeridID of the player
Float:xX coord
Float:yY coord
Float:zZ coord


This function does not return a specific value, it's best to simply ignore it.


// Teleports a player without his car to the center
// of the map if he uses the command "/teleport".
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/teleport",true))
    {            
        SetPlayerPos(playerid,0.0,0.0,10.0);
        return 1;
    }
    return 0;
}

Related Functions

The following functions might be useful as well, as they're related to this function in one way or another.

In other languages