15.07.2013, 12:22
That can be improved to:
So invalid models won't return 3.
pawn Код:
stock GetVehicleType(model)
{
if(model < 400 || model > 611) return 0;
switch(model)
{
case 472, 473, 493, 595, 484, 430, 453, 452, 446: return 1; // Water
case 417, 425, 447, 460, 469, 476, 487, 488, 497, 511, 512, 513, 519, 520,
548, 553, 563, 577, 592, 593, 464, 465, 501: return 2; // Air
default: return 3; // Land
}
return 0;
}