GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] -
RyDeR` - 05.03.2011
Foreword
I made a small includes which allows you to get colors of a vehicle. It's quite useful since SA:MP haven't its own native to do this. It doesn't require you to do or replace anything in your script.
Installation
- Downoad the include from the pastebin link below. (Save it as "GetVehicleColor.inc" so everyone has the same name)
- Include this in the scripts where you want to use GetVehicleColor using
#include <GetVehicleColor>
Function(s)
We only have one function:
pawn Код:
GetVehicleColor(vehicleid, &color1, &color2);
Example(s)
pawn Код:
new
color1,
color2
;
for(new i; i != MAX_VEHICLES; ++i)
{
if(GetVehicleColor(i, color1, color2))
{
printf("VehicleID %d ~ Model %d ~ Color1 %d ~ Color2 %d", i, GetVehicleModel(i), color1, color2);
}
}
This example will print all existing vehicles' colors.
Download
Pastebin - GetVehicleColor v2.1 [02/08/2011]
Changelog
Version 2.1
- Rewritten again.
- A little bit more efficient than before.
- Added random colors when using '-1' as color.
- Added "endinput" when include is already defined.
- Added a macro to easily change the vehicleid property offset.
Version 2.0
- Completely rewritten
- All bugs are fixed, no bugs anymore.
- Added 'strunpack' which solves all messed up colors with some vehicles
- Now works without replacing, changing or adding anything in your scripts. (Plug & Play)
- Safer then before
Older versions
- You don't want to know this!
Notes
- Always update to a newer version when using the old one.
- If you find any bug. Please report below.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - [L3th4l] - 05.03.2011
Did you really had to make a new thread?
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
RyDeR` - 05.03.2011
I asked a moderator to delete the old one so don't post stuff like that.
btw. Yes I had to because all the previous versions were bugged. This one is the most stable version and I want everyone who's using this to update.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
verti4cal - 07.03.2011
Wow thats really cool!
Good job RyDeR!!
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
Strong_ADM - 23.03.2011
Awesome!
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
Stigg - 23.03.2011
Great work again RyDeR, thanks.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
Venice - 23.03.2011
Good Job.awesome
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
Tee - 20.04.2011
Excellent job, I will use this 100/10
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - [03]Garsino - 20.04.2011
It's a shame that this script haven't got more replies than this.
Nice work, RyDeR`, I'll be using this!
Respuesta: GetVehicleColor v2.0 [Update 5'th March 2011] -
[DOG]irinel1996 - 05.06.2011
Really good, like everytime! (Y)
Thanks.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
tbedy - 05.06.2011
this is for changing colors of vehicles INGAME
sry, for my bad english
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
RyDeR` - 05.06.2011
No, this is for retrieving the colors of a vehicle.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
Jay_ - 05.06.2011
What if -1 (random) was specified in the color parameters of AddStatic/CreateVehicle?
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
RyDeR` - 06.06.2011
Quote:
Originally Posted by Jay_
What if -1 (random) was specified in the color parameters of AddStatic/CreateVehicle?
|
Then that value will be set. Obvious.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
Scenario - 07.06.2011
For some reason this doesn't work for me.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
RyDeR` - 07.06.2011
To be honest, I actually didn't know -1 was for random colors with vehicles. I will re-create this system with your suggestion quite soon. Thanks for the info!
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
TheAntonioRHCP - 10.06.2011
What's the command for the colors? lol I didn't find them.
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
RyDeR` - 10.06.2011
Did you even bother reading the first page?
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
FANEX - 04.07.2011
This is amazing dude.
Keep making...
Re: GetVehicleColor v2.0 [Update 5'th March 2011] -
Desertsoulz - 20.07.2011
Very useful! +rep