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. Code Debugger - Minimalistic MTA debug line replacement
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. The Ultimate Lua Tutorial! | MTA PHP SDK
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... Code Debugger - Minimalistic MTA debug line replacement
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. Code Debugger - Minimalistic MTA debug line replacement
Dimmitry007 Posted March 4, 2015 Posted March 4, 2015 function test ( theplayer, seat, jacked ) cancelEvent () end addEventHandler("onVehicleExit", getRootElement(), test ) sup?
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. Code Debugger - Minimalistic MTA debug line replacement
Dimmitry007 Posted March 4, 2015 Posted March 4, 2015 i don't understand you want the player dead body in the car? sup?
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 ) sup?
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] If you find my post useful or if it helped you, please like my post Ingame name: ZoeN
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. Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
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. A unique GangWar gamemode waiting for you!Click here for more information.
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. Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
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 If you find my post useful or if it helped you, please like my post Ingame name: ZoeN
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) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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. Previously known as MrTasty.
.:HyPeX:. Posted March 7, 2015 Posted March 7, 2015 What about attachElements? cold you attach the ped to the car? My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
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