Player

Description

Player entity object is the client of the currently connected user. Once a new player enters the game, the player entity object is added into the player service (Playes). When the player exits the game, the player entity object will be deleted. The player's data can be accessed under the entity object.

Properties

        string    Name
    The custom name of this object.

        string    ClassName
    The object-type name.

        RWObject    Parent
    The parent of this object.

        Enum.HandleMode    ControlType
    In the first person view, camera is always facing the direction that the avatar faces to; In the third person view, camera direction will not change as the avatar facing direction changes, but rotate to the avatar moving direction.

        Enum.PlayerExternalRalation    ExternalRalatioType
    External relations.

        RWObject    Avatar
    Avatar.

        RWObject    StartSpawn
    The spawn location to which the avatar binds.

        RWObject    Team
    Team.

        string    NickName
    NickName.

        int    Uid
    Player ID.

        Vector3    TeamSideColor
    The player's team color.

        Enum.HandleMode    ControlType
    In the first person view, camera is always facing the direction that the avatar faces to; In the third person view, camera direction will not change as the avatar facing direction changes, but rotate to the avatar moving direction.

Functions

    Jump()
    Makes the avatar jump once.

    ClearAvatarAppearance()
    Removes all accessories from the avatar that the player is operating.

    DistanceFromAvatar(point)
    Calculates the distance between the point and the avatar that the player is operating.

    RemoveAvatar()
    Removes the avatar.

    LeaveTeam()
    Leaves the current team.

    JoinTeam(TeamId)
    Joins the specified team.

    LoadCharacter(TarObject)
    Load the avatar at the spawn location. If not exists, load the avatar to the point (0, 0, 0). If the avatar is being operated, this function will not work. If the parameter is filled in, load the specified Avatar object, otherwise load the avatar under StarterPlayers.

Events

    ControlTypeChanged(Playerid)
    This event is triggered when the user input type changes.

    AvatarAdded(rwobject)
    This event is triggered when the avatar is being loaded.

    AvatarRemoving()
    This event is triggered when the avatar is deleted.