1LoL1 Posted November 22, 2015 Share Posted November 22, 2015 Hello i created script but not work how i can fix this i mean: when i use /color RED so setVehicleColor(255, 0, 0) Amount = { "RED" = "255,0,0", "BLUE" = "1,1,1, "PINK" = "2,2,2, "BLACK" = "0,0,0", } function clr (player,command,color) local vehicle = getPedOccupiedVehicle(player) if color then setVehicleColor(vehicle, Amount[#color]) end end addCommandHandler("color", clr) Link to comment
xXMADEXx Posted November 22, 2015 Share Posted November 22, 2015 Try using this: Amount = { }; Amount.RED = { 255, 0, 0 }; Amount.BLUE = { 1, 1, 1 }; Amount.PINK = { 2, 2, 2 }; Amount.BLACK = { 0, 0, 0 }; function clr (player,command,color) local vehicle = getPedOccupiedVehicle(player) if color and vehicle then if ( not Amount [ tostring ( color ):upper ( ) ] ) then return false; end local r, g, b = unpack ( Amount [ tostring ( color ):upper() ] ); setVehicleColor(vehicle, r, g, b ); end end addCommandHandler("color", clr) Please make sure to check debugscript before posting. (/debugscript 3) Link to comment
1LoL1 Posted November 22, 2015 Author Share Posted November 22, 2015 Try using this: Amount = { }; Amount.RED = { 255, 0, 0 }; Amount.BLUE = { 1, 1, 1 }; Amount.PINK = { 2, 2, 2 }; Amount.BLACK = { 0, 0, 0 }; function clr (player,command,color) local vehicle = getPedOccupiedVehicle(player) if color and vehicle then if ( not Amount [ tostring ( color ):upper ( ) ] ) then return false; end local r, g, b = unpack ( Amount [ tostring ( color ):upper() ] ); setVehicleColor(vehicle, r, g, b ); end end addCommandHandler("color", clr) Please make sure to check debugscript before posting. (/debugscript 3) Thanks works. But how i can 2 car colors? now it's only 1. Link to comment
1LoL1 Posted November 22, 2015 Author Share Posted November 22, 2015 Ok Solved i fixed to this: setVehicleColor(vehicle, r, g, b, r, g, b ); 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