Cadu12 Posted January 3, 2012 Share Posted January 3, 2012 I have problem with Race gamemode. It dont me let create vehicle and warpPedIntoVehicle, it will deleted when I created... I cant found some files or/and lines to edit... function onPlayAgainRequest() local veh = exports.race:getPlayerVehicle(source) local model = getVehicleModelFromName(getVehicleName(veh)) local vehicle = createVehicle(model, 4, 0, 3) setElementData(source, 'race.spectating', false) setElementData(source, 'race.playagain', true) setCameraTarget(source, source) spawnPlayer(source, 4, 0, 3) warpPedIntoVehicle(source, vehicle) end addEventHandler("onRequestRespawn", getRootElement(), onPlayAgainRequest) PS: onRequestRespawn is a custom event. Link to comment
Castillo Posted January 3, 2012 Share Posted January 3, 2012 You mean the vehicle get's created but "race" destroys it just after? Link to comment
SDK Posted January 3, 2012 Share Posted January 3, 2012 That's because of the way race works. You can't just create a vehicle and stuff a player in it because race uses it own system to create vehicles (it repairs them on respawn actually). Link to comment
arezu Posted January 3, 2012 Share Posted January 3, 2012 you dont need to create a new vehicle, remove that line and change warp ped to: warpPedIntoVehicle(source, veh) Link to comment
Cadu12 Posted January 3, 2012 Author Share Posted January 3, 2012 function onPlayAgainRequest() local veh = exports.race:getPlayerVehicle(source) setElementData(source, 'race.spectating', false) setElementData(source, 'race.playagain', true) spawnPlayer(source, 4, 0, 3) setCameraTarget(source, source) warpPedIntoVehicle(source, veh) end addEventHandler("onRequestRespawn", getRootElement(), onPlayAgainRequest) Im not sure if it'll works. untested Link to comment
Cadu12 Posted January 4, 2012 Author Share Posted January 4, 2012 Resolved, I got it. Link to comment
Recommended Posts