Reflex# Posted July 4, 2013 Share Posted July 4, 2013 Hey you guys. I would like to ask..for example..I want to make a script..which can create own color for each account. For example my account on server is : Reflex# and I want to have a black color of car. for Race server. And each map I'll play with black color of car. How to do it? Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 setAccountData getAccountData setVehicleColor onVehicleEnter Link to comment
Reflex# Posted July 4, 2013 Author Share Posted July 4, 2013 setAccountData getAccountData setVehicleColor onVehicleEnter Sorry,but I'm a little bit dont understand how to use it. I want to make a list. For example : Reflex -black BlueBerry - green DiablO - purple and else. Link to comment
mcer Posted July 4, 2013 Share Posted July 4, 2013 (edited) Example (Not Tested): function Colorbyplayer() local PlayerNames = getPlayerName(getLocalPlayer()) if isPedInVehicle( getLocalPlayer() ) then if PlayerNames == "Reflex" then local Vehicle = getPedOccupiedVehicle( getLocalPlayer() ) if Vehicle then setVehicleColor( Vehicle, 0, 0, 0 ) end end end end addEventHandler( "onClientRender", rootElement, Colorbyplayer ) Edited July 4, 2013 by Guest Link to comment
Reflex# Posted July 4, 2013 Author Share Posted July 4, 2013 Example (Not Tested): function Colorbyplayer() local PlayerNames = getPlayerName(getLocalPlayer()) if isPedInVehicle( getLocalPlayer() ) then if PlayerNames == "Reflex" then local Vehicle = getPedOccupiedVehicle( uPlayer ) if Vehicle then setVehicleColor( Vehicle, 0, 0, 0 ) end end end end addEventHandler( "onClientRender", rootElement, Colorbyplayer ) You used name..but not account... Link to comment
mcer Posted July 4, 2013 Share Posted July 4, 2013 (edited) Serverside ( In line 3, edit "Acount Name Here" ). function VehicleAccolor () local PlayerbyAccount = getAccountPlayer ( Acount Name Here ) local Vehicle = getPedOccupiedVehicle( PlayerbyAccount ) if ( getElementType ( PlayerbyAccount ) == "player" ) then setVehicleColor( Vehicle, 0, 0, 0 ) end end addEventHandler ( "onVehicleEnter", getRootElement(), VehicleAccolor ) Edited July 4, 2013 by Guest Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 And why do you need a client side script...? Link to comment
mcer Posted July 4, 2013 Share Posted July 4, 2013 And why do you need a client side script...? My bad. Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 No offense, but that script doesn't make much sense. Link to comment
mcer Posted July 4, 2013 Share Posted July 4, 2013 No offense, but that script doesn't make much sense. Don't worry, Is there a mistake? Link to comment
Sasu Posted July 5, 2013 Share Posted July 5, 2013 function VehicleAccolor (player) local accName = getAccountName ( getPlayerAccount( player ) ) if ( accName == "Reflex" )then setVehicleColor( source, 0, 0, 0 ) end end addEventHandler ( "onVehicleEnter", getRootElement(), VehicleAccolor ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now