[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
#2

Did you really had to make a new thread?
Reply
#3

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

Wow thats really cool!

Good job RyDeR!!
Reply
#5

Awesome!
Reply
#6

Great work again RyDeR, thanks.
Reply
#7

Good Job.awesome
Reply
#8

Excellent job, I will use this 100/10
Reply
#9

It's a shame that this script haven't got more replies than this.
Nice work, RyDeR`, I'll be using this!
Reply
#10

Really good, like everytime! (Y)
Thanks.
Reply
#11

this is for changing colors of vehicles INGAME

sry, for my bad english
Reply
#12

No, this is for retrieving the colors of a vehicle.
Reply
#13

What if -1 (random) was specified in the color parameters of AddStatic/CreateVehicle?
Reply
#14

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

For some reason this doesn't work for me.
Reply
#16

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!
Reply
#17

What's the command for the colors? lol I didn't find them.
Reply
#18

Did you even bother reading the first page?
Reply
#19

This is amazing dude.
Keep making...
Reply
#20

Very useful! +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)