micheal1230 Posted May 19, 2012 Posted May 19, 2012 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)
Castillo Posted May 19, 2012 Posted May 19, 2012 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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
micheal1230 Posted May 19, 2012 Author Posted May 19, 2012 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
Castillo Posted May 19, 2012 Posted May 19, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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