Quote:
Originally Posted by PawnHunter
Your code has an issue, you're using vehicleid instead of model id.
PHP код:
GetVehicleType(vehicleid)
{
new model = GetVehicleModel(vehicleid);
switch (model)
{
case 468: return TWO_TIRE_VEHICLE;
case 431, 455, 433, 544: return SIX_TIRE_VEHICLE;
case 509, 510: return NO_TIRE_VEHICLE;
case 417, 453, 473, 484, 487, 497, 511, 592: return ENGINE_ONLY_VEHICLE;
default: return 0;
}
}
|
Oh yes, sorry. I didn't notice that.
By the way, no need to create a new variable when using switch.
Код:
switch (GetVehicleModel(vehicleid))
Would work just fine.
Quote:
Originally Posted by Zeus666
Guys, I have TWO_TIRE_VEHICLE_ADD add too. Should I add
PHP код:
#define TWO_TIRE_VEHICLE_ADD 1
#define SIX_TIRE_VEHICLE_ADD 2
#define NO_TIRE_VEHICLE_ADD 3
#define ENGINE_ONLY_VEHICLE_ADD 4
?
|
I don't get why those are there. Unless I'm reading it incorrectly, they have the exact same definition no?