Reflex# Posted July 4, 2013 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?
Castillo Posted July 4, 2013 Posted July 4, 2013 setAccountData getAccountData setVehicleColor onVehicleEnter
Reflex# Posted July 4, 2013 Author 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.
mcer Posted July 4, 2013 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
Reflex# Posted July 4, 2013 Author 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...
mcer Posted July 4, 2013 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
Castillo Posted July 4, 2013 Posted July 4, 2013 No offense, but that script doesn't make much sense.
mcer Posted July 4, 2013 Posted July 4, 2013 No offense, but that script doesn't make much sense. Don't worry, Is there a mistake?
Sasu Posted July 5, 2013 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 )
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