Jump to content

Vehicle Damage Proof


Minotaur

Recommended Posts

Hello all! :) Im new in the forum please help me in this script this doesn't work :cry: ... Im noob in the scripting :?

function dmg(thePlayer)

local account = getPlayerAccount(thePlayer)

if not account or isGuestAccount(account) then return end

local accountnName = getAccountName(account)

if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) then

end

car = getPedOccupiedVehicle ( player)

if isVehicleDamageProof(car) == true then

setVehicleDamageProof(car, false)

else

setVehicleDamageProof(car, true)

end

end

addCommandHandler ( "damage", dmg )

I want to use this script only the admins and moderators :)

Sorry for bad english im Hungary :lol:

Edited by Guest
Link to comment

Try this

function dmg(thePlayer) 
local account = getPlayerAccount(thePlayer) 
if not account or isGuestAccount(account) then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) then 
end 
car = getPedOccupiedVehicle (thePlayer) 
if isVehicleDamageProof(car) == true then 
setVehicleDamageProof(car, false) 
else 
setVehicleDamageProof(car, true)  
end 
end 
addCommandHandler ( "damage", dmg ) 

Link to comment

Castro's script and your original will work no matter the player is admin or not.

Try this:

function dmg(thePlayer) 
    local account = getPlayerAccount(thePlayer) 
    if not account or isGuestAccount(account) then return end 
    local accountName = getAccountName(account) 
    if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) then 
        local car = getPedOccupiedVehicle (thePlayer) 
        if isVehicleDamageProof(car) then 
            setVehicleDamageProof(car, false) 
            outputChatBox("Your car is mortable", thePlayer) 
        else 
            setVehicleDamageProof(car, true) 
            outputChatBox("Your car is immortable", thePlayer) 
        end 
    else 
        outputChatBox("You have no right to use this command.", thePlayer) 
    end 
end 
addCommandHandler ( "damage", dmg ) 

Edited by Guest
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...