[Include] GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011]
#1

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.
Reply


Messages In This Thread
GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by RyDeR` - 05.03.2011, 16:14
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by [L3th4l] - 05.03.2011, 16:16
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by RyDeR` - 05.03.2011, 16:17
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by verti4cal - 07.03.2011, 12:40
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by Strong_ADM - 23.03.2011, 01:00
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by Stigg - 23.03.2011, 06:58
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by Venice - 23.03.2011, 07:15
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by Tee - 20.04.2011, 18:48
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by [03]Garsino - 20.04.2011, 18:53
Respuesta: GetVehicleColor v2.0 [Update 5'th March 2011] - by [DOG]irinel1996 - 05.06.2011, 16:47
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by tbedy - 05.06.2011, 18:10
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by RyDeR` - 05.06.2011, 21:10
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by Jay_ - 05.06.2011, 21:12
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by RyDeR` - 06.06.2011, 10:26
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by Scenario - 07.06.2011, 13:18
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by RyDeR` - 07.06.2011, 14:55
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by TheAntonioRHCP - 10.06.2011, 10:54
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by RyDeR` - 10.06.2011, 10:57
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by FANEX - 04.07.2011, 18:55
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by Desertsoulz - 20.07.2011, 18:45
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by [WSF]ThA_Devil - 02.08.2011, 08:59
Re: GetVehicleColor v2.0 [Update 5'th March 2011] - by RyDeR` - 02.08.2011, 10:23
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by [WSF]ThA_Devil - 02.08.2011, 11:43
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Laronic - 02.08.2011, 12:03
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Scenario - 02.08.2011, 14:04
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by RyDeR` - 06.08.2011, 12:40
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by titanak - 02.10.2011, 13:20
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Zonoya - 01.11.2011, 17:29
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Zonoya - 01.11.2011, 17:51
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by RyDeR` - 01.11.2011, 18:12
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by titanak - 02.12.2011, 16:12
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by clavador - 16.02.2012, 12:24
Respuesta: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by [Nikk] - 16.02.2012, 13:25
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Hanger - 01.05.2012, 16:50
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Jonny5 - 01.05.2012, 17:21
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by VincentDunn - 01.05.2012, 22:54
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Stgnature - 27.02.2014, 16:03
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Guest4390857394857 - 05.03.2014, 15:34
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by amirm3hdi - 02.05.2015, 00:37
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by ihatetn931 - 02.05.2015, 19:17
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by amirm3hdi - 15.05.2015, 02:37
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by DarK_FeneR - 25.06.2016, 09:34
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Dokins - 09.10.2016, 15:22
Re: GetVehicleColor v2.1 [NEW UPDATE - 02/08/2011] - by Primes007 - 28.12.2017, 13:30

Forum Jump:


Users browsing this thread: 4 Guest(s)