Xabache Posted February 16, 2015 Share Posted February 16, 2015 Taken from MTA Freeroam: function repairVehicle() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then server.fixVehicle(vehicle) end end I want to make this only accessible if the damage is below 50% or it has not been accessed in the last minute by that specific user. I found no getVehicleDamage Link to comment
n3wage Posted February 16, 2015 Share Posted February 16, 2015 For damage below 50%, use: getElementHealth For limit by minutes this should work: repairTick = false function repairVehicle() local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then if not repairTick or repairTick < getTickCount ( ) then server.fixVehicle(vehicle) repairTick = getTickCount() + 60000 else outputChatBox ( "Wait "..math.floor( ( repairTick - getTickCount() ) /1000 ) .." Seconds before repairing again !" ) 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