Vehicle stuff
#1

Well I'm looking for a filterscript about vehicles
/engine(ON/OFF) /trunk(OPEN/CLOSE) /lights(ON/OFF) /lockv
Reply
#2

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.
Reply
#3

Nice one but i will still look for smth else anyways repped
Reply
#4

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 
enginelightsalarmdoorsbonnetbootobjective,vid GetPlayerVehicleID(playerid);
    
GetVehicleParamsEx(videnginelightsalarmdoorsbonnetbootobjective);
    
SetVehicleParamsEx(vid1lightsalarmdoorsbonnetbootobjective);
    
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 
enginelightsalarmdoorsbonnetbootobjective,vid GetPlayerVehicleID(playerid);
    
GetVehicleParamsEx(videnginelightsalarmdoorsbonnetbootobjective);
    
SetVehicleParamsEx(vid0lightsalarmdoorsbonnetbootobjective);
    
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 
enginelightsalarmdoorsbonnetbootobjective;
    
GetVehicleParamsEx(videnginelightsalarmdoorsbonnetbootobjective);
    
SetVehicleParamsEx(videngine1alarmdoorsbonnetbootobjective);
    
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 
enginelightsalarmdoorsbonnetbootobjective;
    
GetVehicleParamsEx(videnginelightsalarmdoorsbonnetbootobjective);
    
SetVehicleParamsEx(videngine0alarmdoorsbonnetbootobjective);
    
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(videnginelightsalarmdoorsbonnetbootobjective);
    
SetVehicleParamsEx(videnginelightsalarm1bonnetbootobjective); //to lock doors 
etc etc. Code untested, let me know if there are errors or shit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)