Gallardo9944 Posted March 3, 2015 Posted March 3, 2015 Hello. I've got a really dumb question, but how can I keep the player in the vehicle in any situation? So he stays in the vehicle even if he dies still. Cancelling onClient(Player)VehicleExit/onVehicleStartExit don't really help with that. Thanks.
Derpy Posted March 3, 2015 Posted March 3, 2015 i dont think its possible, its built in gta so that when u die inside a car that u fall out the door, unless u explode in car though u could try random crazy experiments like freezing the player, or setting position or something, or maybe cancel event of death and "create your own" death system(like fake the death, but still consider it death)?
xXMADEXx Posted March 4, 2015 Posted March 4, 2015 Do you mean keep the corpse of the player in the car? If so, just use createPed and warpPedIntoVehicle.
Gallardo9944 Posted March 4, 2015 Author Posted March 4, 2015 Tried warping the ped instantly, it works, but the transition is rather visible even for an unarmed eye. Cancelling death didn't seem to help at all. Those falling peds are so annoying. There has to be a way to trick that...
Gallardo9944 Posted March 4, 2015 Author Posted March 4, 2015 if not isPedInVehicle I don't need to check if a player is in vehicle, i need to keep the player there. Forever. Without falling out when died standing still.
Dimmitry007 Posted March 4, 2015 Posted March 4, 2015 function test ( theplayer, seat, jacked ) cancelEvent () end addEventHandler("onVehicleExit", getRootElement(), test )
Gallardo9944 Posted March 4, 2015 Author Posted March 4, 2015 function test ( theplayer, seat, jacked ) cancelEvent () end addEventHandler("onVehicleExit", getRootElement(), test ) Same stuff, the player falls out of the vehicle when he dies.
Dimmitry007 Posted March 4, 2015 Posted March 4, 2015 i don't understand you want the player dead body in the car?
Dimmitry007 Posted March 4, 2015 Posted March 4, 2015 i don't know if this will work if it will work then if the player die he will get teleported to 0, 0, 0 position function test ( player ) setElementPosition ( player , 0, 0, 0 ) end addEventHandler ( "onPlayerWasted", getRootElement(), test )
John Smith Posted March 4, 2015 Posted March 4, 2015 its impossible to keep player in car, only possible thing u could do is fake it but it wont look real, try suggesting this as feature on mantis(feature to block player getting out) [but i believe that that request would be ignored like other ones since it's not a bug, but a request, and they're busy]
Tekken Posted March 4, 2015 Posted March 4, 2015 This can work, function keepPlayerInVehicleOnDie() removeEventHandler("onVehicleExit", getRootElement(), keepPlayerInVehicleOnDie) removeEventHandler("onVehicleStartExit", getRootElement(), keepPlayerInVehicleOnDie) end addEventHandler ( "onPlayerWasted", getRootElement(), keepPlayerInVehicleOnDie) Not sure.
arezu Posted March 4, 2015 Posted March 4, 2015 setVehicleHandling animGroup "GetOutF" could maybe have worked, but it was disabled because Get works, set is disabled due to people not knowing this property was vehicle-based and caused crashes.
xeon17 Posted March 4, 2015 Posted March 4, 2015 This can work, function keepPlayerInVehicleOnDie() removeEventHandler("onVehicleExit", getRootElement(), keepPlayerInVehicleOnDie) removeEventHandler("onVehicleStartExit", getRootElement(), keepPlayerInVehicleOnDie) end addEventHandler ( "onPlayerWasted", getRootElement(), keepPlayerInVehicleOnDie) Not sure. onVehicleExit can't be canceled.
Tekken Posted March 4, 2015 Posted March 4, 2015 This can work, function keepPlayerInVehicleOnDie() removeEventHandler("onVehicleExit", getRootElement(), keepPlayerInVehicleOnDie) removeEventHandler("onVehicleStartExit", getRootElement(), keepPlayerInVehicleOnDie) end addEventHandler ( "onPlayerWasted", getRootElement(), keepPlayerInVehicleOnDie) Not sure. onVehicleExit can't be canceled. My bad.
John Smith Posted March 4, 2015 Posted March 4, 2015 This can work, function keepPlayerInVehicleOnDie() removeEventHandler("onVehicleExit", getRootElement(), keepPlayerInVehicleOnDie) removeEventHandler("onVehicleStartExit", getRootElement(), keepPlayerInVehicleOnDie) end addEventHandler ( "onPlayerWasted", getRootElement(), keepPlayerInVehicleOnDie) Not sure. onVehicleExit can't be canceled. though you can reverse it
Moderators IIYAMA Posted March 5, 2015 Moderators Posted March 5, 2015 Try something like this: Client: addEventHandler("onClientPreRender",root, function () local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and local i, firstPlayer = next(getVehicleOccupants(vehicle)) if firstPlayer == localPlayer then if getElementHealth(vehicle) < 250 and not isVehicleDamageProof (vehicle) then setVehicleDamageProof(vehicle,true) triggerServerEvent("blowUpVehicle",vehicle) end end end end) Server: addEvent("blowUpVehicle",true) addEventHandler("blowUpVehicle",root, function () if isElement(source) then setVehicleDamageProof(source,true) local x,y,z = getElementPosition(source) createExplosion (x,y,z,0,client) local players = getVehicleOccupants(source) if players and next(players) then for i,player in pairs (players) do killPed(player) -- add here peds or something like that. end end end end)
Addlibs Posted March 6, 2015 Posted March 6, 2015 How about setting an uninterruptible animation onto the player? I guess that would work, but can't really test it myself at the moment.
.:HyPeX:. Posted March 7, 2015 Posted March 7, 2015 What about attachElements? cold you attach the ped to the car?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now