Jump to content

Make a team, color car


Spyke25

Recommended Posts

Posted

I want yellow car only when you join the team, other member have random car color..

Then, i join GYG team, i have yellow car, i am not in, i have random car color.

Posted

Could you post your teamVehicles TABLE?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

He doesn't have one.

I want yellow car only when you join the team, other member have random car color..

Then, i join GYG team, i have yellow car, i am not in, i have random car color.

Where is that 'car'.

The car he enters?

A car defined somewhere?

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

Then, like that?

local teamGyg = createTeam ( "~GYG~", 255, 255, 0 ) 
  
  
addEventHandler ( "onVehicleStartEnter" , root , 
function ( player ) 
local team = getPlayerTeam ( player ) 
if not team then return end 
local r, g, b = getTeamColor ( team ) 
setVehicleColor ( source , 255, 255, 0 , 255, 255, 0) 
end) 

If is like that, when i join the team my car color doesn't change.

I have replaced your r , g , b with 255 , 0 , 0 is that right? Thanks.

Posted
local teamGyg = createTeam ( "~GYG~", 255, 255, 0 ) 
  
  
function setColors() 
for index , player in ipairs ( getElementsByType ( "player" ) ) do 
if getPlayerTeam ( player ) then 
local r,g,b = getTeamColor ( getPlayerTeam ( player ) ) 
local veh = getPedOccupiedVehicle ( player ) 
if veh then 
setVehicleColor ( veh, r,g,b,r,g,b) 
end 
end 
end 
end 
  
setTimer( setColors, 500, 0 ) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

Posted

=)

Anyway, If you have time to post it, you can post the script for enable an vehicle lights color too? ( At the team ) So, yellow car and yellow lights :P Thanks

Posted
local teamGyg = createTeam ( "~GYG~", 255, 255, 0 ) 
  
function setColors() 
for index , player in ipairs ( getElementsByType ( "player" ) ) do 
if getPlayerTeam ( player ) then 
local r,g,b = getTeamColor ( getPlayerTeam ( player ) ) 
local veh = getPedOccupiedVehicle ( player ) 
if veh then 
setVehicleColor ( veh, r,g,b,r,g,b) 
setVehicleHeadLightColor ( veh , r,g,b ) 
end 
end 
end 
end 
  
setTimer( setColors, 500, 0 ) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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