Jump to content

CarGodMode Script No Error But Doesnt Work


Recommended Posts

There is no error but it doesnt work

function cargodmode(thePlayer) 
    name = getPlayerName(thePlayer) 
    if name == "Harry_Shea" then 
        setVehicleDamageProof(thePlayer, true) 
        outputChatBox("Car GodMode On",thePlayer) 
    end 
end 
addCommandHandler("cargodon",cargodmode) 
  
function cargodmode1(thePlayer) 
    name = getPlayerName(thePlayer) 
    if name == "Harry_Shea" then 
        setVehicleDamageProof(thePlayer, false) 
        outputChatBox("Car GodMode Off",thePlayer) 
    end 
end 
addCommandHandler("cargodoff",cargodmode1) 

Link to comment

You're trying to set the damage proof to the player, not to his/her vehicle.

function cargodmode ( thePlayer ) 
    local name = getPlayerName ( thePlayer ) 
    if ( name == "Harry_Shea" ) then 
        local theVehicle = getPedOccupiedVehicle ( thePlayer ) -- You forgot about this. 
        if ( theVehicle ) then 
            setVehicleDamageProof ( theVehicle, true ) 
            outputChatBox ( "Car GodMode On", thePlayer ) 
        end 
    end 
end 
addCommandHandler ( "cargodon", cargodmode ) 
  
function cargodmode1 ( thePlayer ) 
    local name = getPlayerName ( thePlayer ) 
    if ( name == "Harry_Shea" ) then 
        local theVehicle = getPedOccupiedVehicle ( thePlayer ) -- You forgot about this. 
        if ( theVehicle ) then 
            setVehicleDamageProof ( theVehicle, false ) 
            outputChatBox ( "Car GodMode Off", thePlayer ) 
        end 
    end 
end 
addCommandHandler ( "cargodoff", cargodmode1 ) 

Link to comment
You're trying to set the damage proof to the player, not to his/her vehicle.
function cargodmode ( thePlayer ) 
    local name = getPlayerName ( thePlayer ) 
    if ( name == "Harry_Shea" ) then 
        local theVehicle = getPedOccupiedVehicle ( thePlayer ) -- You forgot about this. 
        if ( theVehicle ) then 
            setVehicleDamageProof ( theVehicle, true ) 
            outputChatBox ( "Car GodMode On", thePlayer ) 
        end 
    end 
end 
addCommandHandler ( "cargodon", cargodmode ) 
  
function cargodmode1 ( thePlayer ) 
    local name = getPlayerName ( thePlayer ) 
    if ( name == "Harry_Shea" ) then 
        local theVehicle = getPedOccupiedVehicle ( thePlayer ) -- You forgot about this. 
        if ( theVehicle ) then 
            setVehicleDamageProof ( theVehicle, false ) 
            outputChatBox ( "Car GodMode Off", thePlayer ) 
        end 
    end 
end 
addCommandHandler ( "cargodoff", cargodmode1 ) 

Thank You

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