Jump to content

HELP ME!! PLEASE!!


waqaarali

Recommended Posts

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
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

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
addCommandHandler("dp", 
function(player) 
local vehicle = getPedOccupiedVehicle(player) 
setVehicleDamageProof(vehicle, true) 
elseif isVehicleDamageProof(theVehicle) == true then 
            setVehicleDamageProof(vehicle, false) 
   end 
end 
) 
  

Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...