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
| Name | Type | Description |
|---|---|---|
| player | player | The player. |
| x, y, z | float | The position in the world. |
| rotation | float | The direction they face, in degrees.default 0 |
| model | string | The 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.