SetPlayerPos

From SA-MP Wiki

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

SetPlayerPos


Set a player's position.


Parameters:
(playerid,Float:x,Float:y,Float:z)
playeridThe ID of the player to set the position of
Float:xThe X coordinate to position the player at
Float:yThe Y coordinate to position the player at
Float:zThe Z coordinate to position the player at


This function does not 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,6.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.

Personal tools
In other languages