05.03.2011, 16:14
(
Последний раз редактировалось RyDeR`; 02.08.2011 в 10:20.
)
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:
Example(s)
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.
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);
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);
}
}
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.