Vehicle Subtypes
#1

Hello there, I got this little question, is it somehow possible to get vehicles subtype in samp?
Reply
#2

Not automaticly, no. But you can make (or search for) arrays storing all subtypes.
Reply
#3

/dl shows subtypes.
Reply
#4

Quote:
Originally Posted by MassDivide
View Post
/dl shows subtypes.
How does that help him? He wants to detect it in the script.

Here's the new version of my 'vFunc' include (not yet released): http://pastebin.com/T00ubRyw

There are two functions:

pawn Code:
GetVehicleModelType(modelid);
GetVehicleType(vehicleid);
These are the defines:

pawn Code:
#define VTYPE_ROAD 0
#define VTYPE_BIKE 1
#define VTYPE_PLANE 2
#define VTYPE_HELI 3
#define VTYPE_BOAT 4
#define VTYPE_TRAIN 5

// Or use VEHICLE_TYPE_x such as VEHICLE_TYPE_ROAD
Although, it's not perfect. For a start, VTYPE_TRAILER is missing. I will fix this before I release it (unless I forget).

The main 'problem' is that there are sub-sub types, for example VTYPE_ROAD has the sub-types truck, van, car etc. and I didn't want to have those as main categories as action that would be taken on them in a script likely wants to simply know whether they're a road vehicle or not, as opposed to a truck/van/car.

RC vehicles also missing. Meh.
Reply
#5

Sorry for bumping,but I just searched for such function which can give me the subtype,and I think it would be handful cause with it we wouldnt need to create our own functions like IsAirVehicle(vehicleid),IsBoat(vehicleid),IsTrain( vehicleid) etc where we would check for vehicle's model.Instead we would just check for its subtype.
Reply
#6

Hello!

I created an include which return a value:
Code:
//return 1 = Fahrzeug existiert nicht!
//return 2 = Auto
//return 3 = Motorrad / Roller
//return 4 = Flugzeug
//return 5 = Helikopter
//return 6 = Boot
//return 7 = LKW / Kleintransporter
//return 8 = Anhдnger
//return 9 = RC Fahrzeuge
//return 10 = Bus
//return 11 = Panzer
//return 12 = Monster Truck
//return 13 = Teile der StraЯenbahn
//return 14 = Fahrrad
//return 15 = Teile des Zuges
//return 16 = Luftkissen
Sorry, this is a german include.
http://gta-sa-mp.de/forum/3-san-andr...eugart-heraus/

Mencent
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)