waqaarali Posted March 16, 2013 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!
waqaarali Posted March 16, 2013 Author Posted March 16, 2013 can you do it for me ? i am really confused!
PaiN^ Posted March 16, 2013 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
Drakath Posted March 16, 2013 Posted March 16, 2013 function proof () setVehicleDamageProof(source, true) end addCommandHandler ( "dp", proof ) function proofoff () setVehicleDamageProof(source, false) end addCommandHandler ( "dpoff", proofoff )
Baseplate Posted March 16, 2013 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
PaiN^ Posted March 16, 2013 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 )
iPrestege Posted March 16, 2013 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!
Baseplate Posted March 16, 2013 Posted March 16, 2013 addCommandHandler("dp", function(player) local vehicle = getPedOccupiedVehicle(player) setVehicleDamageProof(vehicle, true) else setVehicleDamageProof(vehicle, false) end ) Already done Prestege.
iPrestege Posted March 16, 2013 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 .
Renkon Posted March 16, 2013 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 )
Castillo Posted March 16, 2013 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 )
iPrestege Posted March 16, 2013 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 .
Drakath Posted March 16, 2013 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 )
iPrestege Posted March 16, 2013 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 .
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