19.02.2012, 20:13
here is what I use..
can be set for any veh param but here it is
usage: for the doors,
can be set for any veh param but here it is
pawn Код:
enum eVehicleParams: {
engine = 0,
lights = 1,
alarm = 2,
doors = 3,
bonnet = 4,
boot = 5,
objective = 6
}
stock ToggleVehicleParamsEx(vehicleid,eVehicleParams:type,bool:enable)
{
new iengine, ilights, ialarm, idoors, ibonnet, iboot, iobjective;
GetVehicleParamsEx(vehicleid, iengine, ilights, ialarm, idoors, ibonnet, iboot, iobjective);
switch(type)
{
case 0:{SetVehicleParamsEx(vehicleid, enable, ilights, ialarm, idoors, ibonnet, iboot, iobjective);}
case 1:{SetVehicleParamsEx(vehicleid, iengine, enable, ialarm, idoors, ibonnet, iboot, iobjective);}
case 2:{SetVehicleParamsEx(vehicleid, iengine, ilights, enable, idoors, ibonnet, iboot, iobjective);}
case 3:{SetVehicleParamsEx(vehicleid, iengine, ilights, ialarm, enable, ibonnet, iboot, iobjective);}
case 4:{SetVehicleParamsEx(vehicleid, iengine, ilights, ialarm, idoors, enable, iboot, iobjective);}
case 5:{SetVehicleParamsEx(vehicleid, iengine, ilights, ialarm, idoors, ibonnet, enable, iobjective);}
case 6:{SetVehicleParamsEx(vehicleid, iengine, ilights, ialarm, idoors, ibonnet, iboot, enable);}
}
return 1;
}
pawn Код:
ToggleVehicleParamsEx(vehicleid,3,0); // unlocks doors
ToggleVehicleParamsEx(vehicleid,3,1); //locks doors