Jump to content

Car paint


extlatvia

Recommended Posts

then no one can give script ? Someone give me

  
function checkName() 
  local players = getElementsByType("player") 
  for theKey, thePlayer in ipairs(players) do 
  auto = getPedOccupiedVehicle(thePlayer) 
  thePlayerAcc = getPlayerAccount(thePlayer) 
   for i = 1, #names do 
    if auto and (getAccountName(thePlayerAcc) == names[i][1] ) then 
    setVehicleColor(auto, names[i][2], names[i][3], names[i][4], names[i][5], names[i][6], names[i][7]) 
    setVehicleHeadLightColor (auto, names[i][2], names[i][3], names[i][4], names[i][5], names[i][6], names[i][7]) 
    setVehicleOverrideLights (auto, 2) 
    end 
   end 
  end 
end 
addEvent("checkColour", true) 
addEventHandler("checkColour", getRootElement(), checkName) 

But idk how set car color for my Account . :( I am noob in Scripting. :(

Link to comment
addEventHandler( 'onPlayerLogin', root, 
  function() 
    local veh = getPedOccupiedVehicle( source ); 
    if veh and isObjectInACLGroup( 'user.'..getPlayerName( source ), aclGetGroup( 'Admin' ) ) then 
      setVehicleColor( veh, 0, 0, 0, 0 ); --color it with black 
    end; 
  end 
); 

Link to comment

LOOOOOL Your code is wrong again X-SHADOW.

addEventHandler ( 'onPlayerLogin', root, 
    function ( _, acc ) 
        if ( getPedOccupiedVehicle ( source ) and isObjectInACLGroup ( 'user.' .. getAccountName ( acc ), aclGetGroup ( 'Admin' ) ) ) then 
            setVehicleColor ( getPedOccupiedVehicle ( source ), R, G, B ); 
        end 
    end 
) 

Link to comment

1st - You need check if account name is in ACL Group, not player name.

2nd - setVehicleColor have three optional arguments: 2 - [ R, G, B ]; 3 - [ R, G, B ]; 4 - [ R, G, B ]

And you're using the first required color package and COLOR R of argument 2 ( optional ).

Link to comment
local theAccount = '' 
  
addCommandHandler ( 'account', 
    function ( ped, cmd, acc ) 
        if ( not acc ) then return end; 
        theAccount = tostring ( acc ) 
    end 
) 
  
addEventHandler ( 'onPlayerLogin', root, 
    function ( _, acc ) 
        if ( getAccountName ( acc ) == theAccount ) then 
            setVehicleColor ( getPedOccupiedVehicle ( source ), R, G, B ); 
        end 
    end 
) 

Example:

/account dream

On player login will set vehicle color if account is 'dream'.

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