justn Posted July 7, 2014 Share Posted July 7, 2014 Hi, im working on a voteredo script, how do i check, when a player hits the hunter, if hes the only person alive and with a hunter, then the map will restart ? and if everyone dies, the map restarts. Thanks. Link to comment
MTA Team botder Posted July 7, 2014 MTA Team Share Posted July 7, 2014 https://wiki.multitheftauto.com/wiki/Resource:Race The race resource has a nice event for that purpose: onPlayerPickUpRacePickup You have to use the parameter vehicleModel to check if the new vehicle will be a hunter (== 425). Link to comment
justn Posted July 7, 2014 Author Share Posted July 7, 2014 I know how to use that.. i mean, how to check, if that player is the only person is alive ? and how to see when everyone dies, so the map can restart? Link to comment
Max+ Posted July 7, 2014 Share Posted July 7, 2014 addEvent ( 'onPlayerPickUpRacePickup' , true ) addEventHandler ( 'onPlayerPickUpRacePickup' , root, function ( pickupType, vehicleModel, mapInfo ) local alivePlayers = getAlivePlayers() info = mapInfo.modename if info == "Destruction derby" then if #alivePlayers == 1 and ( pickupType == 'vehiclechange' and vehicleModel == 425 ) then --- do something end end end ) Link to comment
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