Jump to content

Color Vehicle for Group HELP !


DonOmar

Recommended Posts

hello guys today, i'am asking for improving my code to make enable using the command with just a Group in acl ! i made it but it failed here is the code.

Amount = { }; 
Amount.RED = { 255, 0, 0 }; 
Amount.BLUE = { 1, 1, 1 }; 
Amount.PINK = { 2, 2, 2 }; 
Amount.BLACK = { 0, 0, 0 }; 
  
function clr (player,command,color) 
    local vehicle = getPedOccupiedVehicle(player) 
    if color and vehicle then 
        if ( not Amount [ tostring ( color ):upper ( ) ] ) then 
            return false; 
        end 
        
        local r, g, b = unpack ( Amount [ tostring ( color ):upper() ] ); 
        setVehicleColor(vehicle, r, g, b ); 
    end 
end 
addCommandHandler("color", clr)  
  

Link to comment
heeeeelp please
Amount = { }; 
Amount.RED = { 255, 0, 0 }; 
Amount.BLUE = { 1, 1, 1 }; 
Amount.PINK = { 2, 2, 2 }; 
Amount.BLACK = { 0, 0, 0 }; 
  
function clr (player,command,color) 
    local vehicle = getPedOccupiedVehicle(player) 
    if color and vehicle then 
        if ( not Amount [ tostring ( color ):upper ( ) ] ) then 
            return false; 
        end 
        if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then 
        local r, g, b = unpack ( Amount [ tostring ( color ):upper() ] ); 
        setVehicleColor(vehicle, r, g, b ); 
        else 
        outputChatBox("text", player, 255, 255, 255, true) 
        end 
    end 
end 
addCommandHandler("color", clr) 
  

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