Jump to content

Car paint


extlatvia

Recommended Posts

Posted
oh its hard you must enter scripting world lol

It's not so hard.

--

Anyway, if you're interested in creating your own, if you need help, post in Scripting section.

Posted

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

Posted
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 
); 

Posted

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 
) 

Posted

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

Posted

The code will get automatically your account on login, in my code change R, G, B to your color and add R, G, B again with second rgb color.

Posted
r2 g2 b2 is optional, do not need to add if you want to change only the first color
and set first / second car color ? (
Posted (edited)
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

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