Jump to content

Question,READ IT please


xTravax

Recommended Posts

Posted

Hey,i need script for automatically car colour set. I want that admins always get black car colour moderators get red colour super moderators get blue colour and members get yellow colour.i asked this because other server have that

On race gamemode

  • Moderators
Posted (edited)
setTimer ( black, 2000, 1) --check timer > function black. 
function black (player)  
local account = getAccountName(getPlayerAccount(player)) --get account 
    if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then --check if it is admin 
    local theVehicle = getPlayerOccupiedVehicle ( player ) -- get the vehicle 
            if theVehicle then -- check if it does exist 
            setVehicleColor ( theVehicle, 0, 0, 0, [0, 0, 0,] [0, 0, 0,] [0, 0, 0] ) --setcolor 
            end 
  
    end 
end 

I used the timer because in a race map, you wont enter your vehicle.. but you spawn with it.

-- Maybe this... I can't test it right now (school).....

I hope it works.

Edited by Guest
Posted
  
function setAdminColor (player) 
 local theAccount=getPlayerAccount(player) 
    if theAccount then 
    local accountName = getAccountName(theAccount) 
    if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then 
     local vehicle = getPedOccupiedVehicle(player) 
    setVehicleColor ( vehicle, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) -- Black rgb rgb2 rgb3 rgb4 
    setVehicleOverrideLights(vehicle, 2) -- Light on 
    setVehicleHeadLightColor(vehicle, 0, 0, 0, 0) -- u can set the color light r g b alpha 
       else 
    setVehicleColor ( vehicle, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) -- Yellow Normaly Player 
        end      
end 
end 
function spawnAdmin() 
setTimer(setAdminColor,500,1,source) 
end 
addEventHandler("onPlayerLogin",getRootElement(),spawnAdmin) 
addEventHandler("onPlayerSpawn",getRootElement(),spawnAdmin) 
  

This is for admin,u can edit this for supermod and mod.

Posted
You can better try that one of Hunterix.. Because I am not sure about my script :wink:

timers, event handlers and command handlers functions have to be after the function because the function not exists.

Posted
ops lol forgotten :o

No problem :lol: Only don't forget: Don't use event, command handlers and timer function names before you create the function or you will get error. :D

And pls, start tabulating your code :)

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