Quote:
Originally Posted by Konstantinos
pawn Код:
stock HF_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay) { new vehicleid = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay); if (vehicleid != INVALID_VEHICLE_ID) // not invalid modelid or full { Engine[vehicleid] = 0; new engine, lights, alarm, doors, bonnet, boot, objective; GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective); } return 1; }
#if defined _ALS_CreateVehicle #undef CreateVehicle #else #define _ALS_CreateVehicle #endif
#define CreateVehicle HF_CreateVehicle
Although you get the engine parameter so the array for toggling the engine is kind of pointless.
Do the same for AddStaticVehicle and AddStaticVehicleEx functions.
|
https://sampwiki.blast.hk/wiki/ManualVehicleEngineAndLights
SA-MP has native function for this.
and I think this should be:
pawn Код:
stock HF_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
{
new vehicleid = CreateVehicle(modelid, x, y, z, angle, color1, color2, respawn_delay);
if (vehicleid != INVALID_VEHICLE_ID) // not invalid modelid or full
{
Engine[vehicleid] = 0;
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
return vehicleid;
}
return INVALID_VEHICLE_ID;
}