SoundWave Posted March 28, 2011 Posted March 28, 2011 Hey everyone i have a question I have a /br function ==> it repairs your vehicle when you press /br but it also repairs when the vehicle has 100% health my question: Is there a way to check the vehicles health because i didn't find the code on mta wiki. this means when a player types /br and his vehicle has 100% health it outputs in chatbox: Your vehicle doesn't need to be fixed. Thanks in advance
proracer Posted March 28, 2011 Posted March 28, 2011 function fixPlayerVeh ( ) local veh = getPedOccupiedVehicle ( source ) if (not veh) then return if (getElementHealth(veh)) == 1000 then outputChatBox ( "Your Vehicle doesn't need to be fixed.", source ) -- not sure if this is max health (could be 100 or 1000) else fixVehicle ( veh ) end end end end addEventHandler ( 'br', fixPlayerVeh )
Moderators Citizen Posted March 28, 2011 Moderators Posted March 28, 2011 Praracer are you sure ? : addEventHandler ( 'br', fixPlayerVeh ) It's better like that no ? addCommandHandler( 'br', fixPlayerVeh )
Moderators Citizen Posted March 28, 2011 Moderators Posted March 28, 2011 Don't say sorry, I will not kill you for that ^^
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