Make vehicle color darker
#1

Hi everyone,

Like the title says, I want to make my vehicle's color darker, let's say every 10 seconds.
Like the hex code has the last 2 numbers to control the opacity, I wanted to manipulate the vehicle's color in the same way.

So that will be, every 10 seconds: vehicle color-0.1 opacity.

Not sure if this is well enough explained, but I can't think of anything better to explain it..

Thanks in advance
Reply
#2

SendRconCommand
Reply
#3

Quote:
Originally Posted by Magic_Time
View Post
SendRconCommand
How would SendRconCommand help here?
Reply
#4

Let's say.
You create a command to change the color of the car.
You'll make a timer for 10 seconds.
And the car color will change when you call it-.
Reply
#5

I know that, the real problem is, to take the color the car already has, let's say yellow, and every 10 seconds it has to become darker..
Reply
#6

I don't know if it's possible to make the car get darker.
What would happen if you store the hex values on an array?
So you call them when you want to make the car color dark?
Reply
#7

I think that would be the only "easy" solution there is :\
Thanks, I will try it with a few test colors first, shouldn't be too hard
Reply
#8

I was looking for something.
I found it out.

May it help you?

PHP Code:
stock RGBAToHex(rgba
{
    return (
r<<24 g<<16 b<<a);
}
stock HexToRGBA(colour, &r, &g, &b, &a)
{
    
= (colour >> 24) & 0xFF;
    
= (colour >> 16) & 0xFF;
    
= (colour >> 8) & 0xFF;
    
colour 0xFF;

Reply
#9

I think this will be very helpfull, thanks
Reply
#10

With this link you can download MP2's - vFunc.

By which you can get GetVehicleColor() and try to make it darker according to what you get. It will be a lot of calculations but it is possible this way also!
Reply
#11

Quote:
Originally Posted by Ballu Miaa
View Post
With this link you can download MP2's - vFunc.

By which you can get GetVehicleColor() and try to make it darker according to what you get. It will be a lot of calculations but it is possible this way also!
Thanks alot
I will try to make something with this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)