18.01.2016, 15:49
I don't understand why people create vehicles like this it is absolutely counter intuitive of how it SHOULD be done quick example to make everything easier.
@Jeff what you are doing is extremely silly trying to use vehicleid ranges to determine vehicle types just blows my mind of the sheer illogics of such design.
Код:
#define VEHICLE_TYPE_NONE 0 #define VEHICLE_TYPE_NORMAL 1 #define VEHICLE_TYPE_COPCAR 2 enum VEHICLEINFO { vType, Float:vSpawnHP, } static VehicleData[MAX_VEHICLES][VEHICLEINFO]; stock CreateFactionVehicle(type, modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, Float:health=1000.0, addsiren=0) { new index = CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, addsiren); VehicleData[index][vType] = type; VehicleData[index][vSpawnHP] = health; return index; } IsCopCar(vehicleid) { if(vehicleid > 0 && vehicleid < MAX_VEHICLES) if(VehicleData[index][vType] == VEHICLE_TYPE_COPCAR) return 1; return 0; } GetVehicleType(vehicle) { if(vehicleid > 0 && vehicleid < MAX_VEHICLES) return VehicleData[vehicleid][vType]; return VEHICLE_TYPE_NONE; }