I've change it to:
addEventHandler ( "onClientPlayerWasted", localPlayer, -- changed to localPlayer as I only want it to take effect on the local client
function ( thePlayer )
if ( isPedInVehicle ( source) ) then -- source because the first argument is the player's killer
-- removePedFromVehicle ( source); -- moved to server side since the vehicle was created server side
end
local x, y, z, lookx, looky, lookz = getCameraMatrix();
setCameraMatrix ( x, y, z, lookx, looky, lookz );
end
);
Still didn't work.