x,y,z hasnt got a spawn position so he will have another error
-- Learning MTA's script system
function playerSpawnAt()
local x = 2031
local y = -1405
local z = 17.4
outputChatBox("Calling: playerSpawnAt("..x..", "..y..", "..z..")", source)
spawnPlayer(source, x, y, z)
fadeCamera(source, true)
setCameraTarget(source, source)
end
function doOnJoin()
outputChatBox("Calling: doOnJoin()", source)
playerSpawnAt(source, 2031, -1405, 17.4)
end
function doOnDeath()
outputChatBox("Calling: doOnDeath()", source)
setTimer(playerSpawnAt, 2000, 1, source)
end
addEventHandler("onPlayerJoin", getRootElement(), doOnJoin)
addEventHandler("onPlayerWasted", getRootElement(), doOnDeath)
change the x y z to the position you like