Vehicle stuff -
JamalMaddox - 25.01.2016
Well I'm looking for a filterscript about vehicles
/engine(ON/OFF) /trunk(OPEN/CLOSE) /lights(ON/OFF) /lockv
Re: Vehicle stuff -
valych - 25.01.2016
Try this one:
https://sampforum.blast.hk/showthread.php?tid=197115. At least you can extract some pieces of code if it's not what you are actually looking for.
Re: Vehicle stuff -
JamalMaddox - 25.01.2016
Nice one but i will still look for smth else anyways repped
Re: Vehicle stuff -
TwinkiDaBoss - 25.01.2016
Engine
PHP код:
new
EngineStatus[MAX_VEHICLES]; //top of the script
CMD:engineon(playerid,params[]) {
if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid,COLOR_RED,"You are not inside any vehicles");
new vid = GetPlayerVehicleID(playerid);
if(EngineStatus[vid] == 1) return Msg(playerid,COLOR_RED,"This vehicles engine is already running");
new engine, lights, alarm, doors, bonnet, boot, objective,vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, 1, lights, alarm, doors, bonnet, boot, objective);
EngineStatus[vid] = 1;
return true;
}
CMD:engineoff(playerid,params[]) {
if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid,COLOR_RED,"You are not inside any vehicles");
new vid = GetPlayerVehicleID(playerid);
if(EngineStatus[vid] == 0) return Msg(playerid,COLOR_RED,"This vehicles engine is already turned off");
new engine, lights, alarm, doors, bonnet, boot, objective,vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective);
EngineStatus[vid] = 0;
return true;
}
lights
PHP код:
new VehicleLights[MAX_VEHICLES];
CMD:lightson(playerid,params[]) {
if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid,COLOR_RED,"You are not inside any vehicles");
new vid = GetPlayerVehicleID(playerid);
if(VehicleLights[vid] == 1) return Msg(playerid,COLOR_RED,"This vehicle lights are already on");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, engine, 1, alarm, doors, bonnet, boot, objective);
VehicleLights[vid] = 1;
return true;
}
CMD:lightsoff(playerid,params[]) {
if(!IsPlayerInAnyVehicle(playerid)) return Msg(playerid,COLOR_RED,"You are not inside any vehicles");
new vid = GetPlayerVehicleID(playerid);
if(VehicleLights[vid] == 0) return Msg(playerid,COLOR_RED,"This vehicle lights are already off");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, engine, 0, alarm, doors, bonnet, boot, objective);
VehicleLights[vid] = 0;
return true;
}
You get my point. Just change the variables and you can change what you want. For locks, add
PHP код:
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, engine, lights, alarm, 1, bonnet, boot, objective); //to lock doors
etc etc. Code untested, let me know if there are errors or shit