Or, create something like this:
function spawnCorpse( )
local x,y,z = getElementPosition(source)
local mod = getElementModel(source)
local rot = getPedRotation(source)
local dead = createPed(mod,x,y,z,rot)
setPedAnimation(dead,...)
end
onPlayerSpawn:Handle(spawnCorpse)
Ofcourse this is just mixed openframe code. But yes, thats rough code.