Vehicle Subtypes - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle Subtypes (
/showthread.php?tid=406340)
Vehicle Subtypes -
CoaPsyFactor - 10.01.2013
Hello there, I got this little question, is it somehow possible to get vehicles subtype in samp?
Re: Vehicle Subtypes -
LarzI - 10.01.2013
Not automaticly, no. But you can make (or search for) arrays storing all subtypes.
Re: Vehicle Subtypes -
MassDivide - 10.05.2013
/dl shows subtypes.
Re: Vehicle Subtypes -
MP2 - 10.05.2013
Quote:
Originally Posted by MassDivide
/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.
Re: Vehicle Subtypes -
BGTrucker - 19.04.2015
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.
Re: Vehicle Subtypes -
Mencent - 19.04.2015
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