waqaarali Posted March 16, 2013 Share Posted March 16, 2013 I want to make a damage proof script for vehicles, so when someone type /dp in game it will be activated? when they type it again it will be deactivated! Anyone help me out! Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 setVehicleDamageProof addCommandHandler Link to comment
waqaarali Posted March 16, 2013 Author Share Posted March 16, 2013 can you do it for me ? i am really confused! Link to comment
PaiN^ Posted March 16, 2013 Share Posted March 16, 2013 You have to do it so you can learn, It's an easy script, Take your time ... If you couldn't, Post your attempt and we'll fix it for you Link to comment
Drakath Posted March 16, 2013 Share Posted March 16, 2013 function proof () setVehicleDamageProof(source, true) end addCommandHandler ( "dp", proof ) function proofoff () setVehicleDamageProof(source, false) end addCommandHandler ( "dpoff", proofoff ) Link to comment
Baseplate Posted March 16, 2013 Share Posted March 16, 2013 (edited) addCommandHandler("dp", function(player) local vehicle = getPedOccupiedVehicle(player) setVehicleDamageProof(vehicle, true) else setVehicleDamageProof(vehicle, false) end ) Edited March 16, 2013 by Guest Link to comment
PaiN^ Posted March 16, 2013 Share Posted March 16, 2013 function proof () setVehicleDamageProof(source, true) end addCommandHandler ( "dp", proof ) function proofoff () setVehicleDamageProof(source, false) end addCommandHandler ( "dpoff", proofoff ) I would love that waqaarali do it, But since you did and there are some mistakes, I'll fix it : addCommandHandler ( 'dp', function ( ) local car = getPedOccupiedVehicle ( source ) setVehicleDamageProof ( car, true ) end ) addCommandHandler ( 'dpoff', function ( ) local car = getPedOccupiedVehicle ( source ) setVehicleDamageProof ( car, false ) end ) Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 I want to make a damage proof script for vehicles, so when someone type /dp in game it will be activated? when they type it again it will be deactivated!Anyone help me out! Link to comment
Baseplate Posted March 16, 2013 Share Posted March 16, 2013 addCommandHandler("dp", function(player) local vehicle = getPedOccupiedVehicle(player) setVehicleDamageProof(vehicle, true) else setVehicleDamageProof(vehicle, false) end ) Already done Prestege. Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 addCommandHandler("dp", function(player) local vehicle = getPedOccupiedVehicle(player) setVehicleDamageProof(vehicle, true) else setVehicleDamageProof(vehicle, false) end ) Already done Prestege. No, this is wrong . Link to comment
waqaarali Posted March 16, 2013 Author Share Posted March 16, 2013 Don't work please help! Link to comment
Renkon Posted March 16, 2013 Share Posted March 16, 2013 addCommandHandler("dp", function(player) local vehicle = getPedOccupiedVehicle(player) if not vehicle then return end if not isVehicleDamageProof(vehicle) then setVehicleDamageProof(vehicle, true) else setVehicleDamageProof(vehicle, false) end ) Link to comment
Castillo Posted March 16, 2013 Share Posted March 16, 2013 Samer's code of course it won't work, he's using an "else" without an "if". addCommandHandler ( "dp", function ( player ) local vehicle = getPedOccupiedVehicle ( player ) if ( vehicle ) then setVehicleDamageProof ( vehicle, not isVehicleDamageProof ( vehicle ) ) end end ) Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 addCommandHandler("dp", function(player) local vehicle = getPedOccupiedVehicle(player) if not vehicle then return end if not isVehicleDamageProof(vehicle) then setVehicleDamageProof(vehicle, true) else setVehicleDamageProof(vehicle, false) end ) This is wrong to . Link to comment
waqaarali Posted March 16, 2013 Author Share Posted March 16, 2013 Please give me a correct working one ;( Link to comment
waqaarali Posted March 16, 2013 Author Share Posted March 16, 2013 Please give me a correct working one ;( Link to comment
Drakath Posted March 16, 2013 Share Posted March 16, 2013 addCommandHandler("dp", function(player) local vehicle = getPedOccupiedVehicle(player) setVehicleDamageProof(vehicle, true) elseif isVehicleDamageProof(theVehicle) == true then setVehicleDamageProof(vehicle, false) end end ) Link to comment
iPrestege Posted March 16, 2013 Share Posted March 16, 2013 Samer's code of course it won't work, he's using an "else" without an "if". addCommandHandler ( "dp", function ( player ) local vehicle = getPedOccupiedVehicle ( player ) if ( vehicle ) then setVehicleDamageProof ( vehicle, not isVehicleDamageProof ( vehicle ) ) end end ) This one . 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