Jump to content

HELP ME!! PLEASE!!


waqaarali

Recommended Posts

Posted

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!

Posted

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

Posted
function proof () 
    setVehicleDamageProof(source, true) 
end 
addCommandHandler (  "dp", proof ) 
  
function proofoff () 
    setVehicleDamageProof(source, false) 
end 
addCommandHandler (  "dpoff", proofoff ) 
  

Posted (edited)
addCommandHandler("dp", 
function(player) 
local vehicle = getPedOccupiedVehicle(player) 
setVehicleDamageProof(vehicle, true) 
else 
setVehicleDamageProof(vehicle, false) 
end 
) 

Edited by Guest
Posted
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 
) 

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

Posted
addCommandHandler("dp", 
function(player) 
local vehicle = getPedOccupiedVehicle(player) 
setVehicleDamageProof(vehicle, true) 
else 
setVehicleDamageProof(vehicle, false) 
end 
) 

Already done Prestege.

Posted
addCommandHandler("dp", 
function(player) 
local vehicle = getPedOccupiedVehicle(player) 
setVehicleDamageProof(vehicle, true) 
else 
setVehicleDamageProof(vehicle, false) 
end 
) 

Already done Prestege.

No, this is wrong .

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

Posted

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 
) 

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

Posted
addCommandHandler("dp", 
function(player) 
local vehicle = getPedOccupiedVehicle(player) 
setVehicleDamageProof(vehicle, true) 
elseif isVehicleDamageProof(theVehicle) == true then 
            setVehicleDamageProof(vehicle, false) 
   end 
end 
) 
  

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

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