Vehicle Colour

Started by Kewun, Apr 02, 2016, 03:24 PM

Previous topic - Next topic

Kewun

Hi, i want ask little question
What is the random colour of vehicle? -1 gives me white, nothing more :/
i remember it was (0x something but i dont remember
what is the random color?

DizzasTeR

function RandomCarColor() { return rand() % 94 }
Now if you want to give your vehicle a random color just use that function, it will generate a random color.

MaTaDeToR

Quote from: Kewun on Apr 02, 2016, 03:24 PMHi, i want ask little question
What is the random colour of vehicle? -1 gives me white, nothing more :/
i remember it was (0x something but i dont remember
what is the random color?
-1, doesn't works, in VC-MP for RANDOM; rand() is the function in SQ, for random.....
i.e: if ( cmd =="changecolor")
                       {
                          if ( player.Vehicle )
                                  {
                                  local Color = rand() % 94;
                                  ClientMessage("Your Vehicle color has been changed randomly",player,255,255,0);
                                             player.Vehicle.Colour1 = Color;
                                                    }
                                 else ClientMessage("You need to be inside a vehicle to use this command",player,255,255,0);
                  }
:)
                                         

MacTavish

Doom was meant by this CreateVehicle(146,0,Vector(.Pos.x, player.Pos.y+3, player.Pos.z), player.Angle, RandomCarColor(), RandomCarColor() );

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

MaTaDeToR

#4
Quote from: Ben on Apr 03, 2016, 05:59 PMplzzz tell me how to give cash
player.Cash += Ammount;it can use in differ ways! such as :
if ( cmd =="cash")
{
ClientMessage("Your Cash is " + player.Cash +"",player,255,255,0);
}
if ( cmd =="increase")
            {
           ClientMessage("Increased",player,255,255,0);
           //now here you can use different type i.e : player.Cash = 100; this increases the cash to set amount
         // player.Cash += 2; this is used to increase the exact amount....
         // player.Cash ++; this is just used to increase 1 Amount of cash....
          player.Cash++;
}
Decrease could be done in the same way, but just change the "+" sign into "-"; This function could be found in the Wiki @Ben

NicusorN5

For spawning a car with random color use:
CreateVehicle(130,0,player.Pos.x,player.Pos.y+20,player.Pos.z+5,0,rand() % 94 , rand() % 94 );Tested it!

KAKAN

Quote from: NicusorN5 on Apr 07, 2016, 12:35 PMFor spawning a car with random color use:
CreateVehicle(130,0,player.Pos.x,player.Pos.y+20,player.Pos.z+5,0,rand() % 94 , rand() % 94 );Tested it!
Do you ever read the replies :D?
The answer has already been posted.
oh no