Got a problem here with camera...
According to my idea, after player dies and 4 seconds delay passes he will respawn at the certain place (-1951.37, 148.78, 26.28) and facing west (, 90). It works, but camera wouldn't look at west as the ped does. I tried fix this with setCameraMatrix. It actualy looks where I need to, but then I couldn't get back to Ped camera. I tried few variations with setCameraTarget and tried to cancel setCameraMatrix after it's true. Either way, it won't work. Maybe I did something wrong, I dunno.
function setCameraOnPlayerSpawn()
setTimer( spawnPlayer, 4000, 1, source, -1951.37, 148.78, 26.28, 90 )
deathCam = setCameraMatrix(source, -1984, 210, 37.95, -2024.27, 148.62,28.835)
if (deathCam == true) then
cancelEvent()
end
end
addEventHandler( "onPlayerWasted", getRootElement(),setCameraOnPlayerSpawn)