- Documentation
- Server functions
- isPlayerSpawned
Function
isPlayerSpawned
Checks whether the player is in the world and alive. After death it returns false until the next spawn.
Syntax
bool isPlayerSpawned(player thePlayer)Arguments
thePlayerplayer- The player.
Returns
true if alive in the world.
Example
addCommandHandler("auto", function(player)
if not isPlayerSpawned(player) then return end
local x, y, z = getElementPosition(player)
warpPedIntoVehicle(player, createVehicle(411, x, y, z))
end)