[Include] carcols.dat random colors
#1

Introduction
This is just a simple include which allows you to get 2 random matching colors of a vehicle (based on carcols.dat). Originally, you could use "-1" as the color, but it's very glitchy.

It took about an hour to fetch all of the data from "carcols.dat". Then, I had to sort each entry in the array!

Purpose
In default GTA:SA, vehicles are spawned around the map and given random colors, based on the vehicle's model. To replicate this in SA-MP, you could use "-1" as the color parameter, but it's glitchy (the colors change when you enter and exit interiors). This include fixes that!

Functions
Currently, there is only one function:

pawn Код:
forward GetRandomModelColors(modelid, &color1, &color2);
For example, to get 2 random colors for the "Infernus" vehicle:

pawn Код:
new
    color1,
    color2;

GetRandomModelColors(411, color1, color2);
ChangeVehicleColor(vehicleid, color1, color2);
Download
http://pastebin.com/TEE9DKJ1
Reply


Messages In This Thread
carcols.dat random colors - by Emmet_ - 14.03.2014, 09:38
Re: carcols.dat random colors - by RenSoprano - 14.03.2014, 09:53
Re: carcols.dat random colors - by Emmet_ - 14.03.2014, 10:23
Re: carcols.dat random colors - by Emmet_ - 15.03.2014, 08:29
Re: carcols.dat random colors - by ball - 25.02.2015, 12:49

Forum Jump:


Users browsing this thread: 1 Guest(s)