M MY Multiplayer: Wiki
Side
Kind

spawnPlayer

Server

Places the player in the world, with health at 100, no armour, in interior 0 and with no weapons.

bool spawnPlayer(player player, float x, y, z [, float rotation = 0, string model = male01])

Parameters

NameTypeDescription
playerplayerThe player.
x, y, zfloatThe position in the world.
rotationfloatThe direction they face, in degrees.default 0
modelstringThe ped model's name.default male01

Returns

true if the player spawned, false if the element is not a player, the model is not a ped model or the position is not valid.

Fires onPlayerSpawn on the player.

Example

addEventHandler("onPlayerJoin", root, function()
    spawnPlayer(source, 2495.1, -1687.4, 13.5, 90, "male01")
end)
Coming from MTAThe model is given by the ped model's name, not a skin id, and there are no interior, dimension or team parameters.

See also