Jump to content

Car paint


extlatvia

Recommended Posts

Posted
Use this functions :
createVehicle 
setVehicleColor 

he wants the script to not the function.

Please do not PM me with scripting related question nor support, use the forums instead.

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.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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

this well get all players Account and set There Car Lights

do you want it for all or just for you = admin ?

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

Posted

We will not give you the full script. Script by yourself. We only help making.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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

My ingame nickname : Ops!

-DeathMatch GameMode By Ops! : 5%

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 
) 

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

r2 g2 b2 is optional, do not need to add if you want to change only the first color

Please do not PM me with scripting related question nor support, use the forums instead.

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 ? (

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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