Originally Posted by park4bmx
because i cant be asked to download your script i will tell you how to do it
in your GameMode
SIMPLE way
pawn Код:
//Where is OnPlayerEnterVehicle (Fin it and remove your function for the engine & replace it with this) public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective); return 1; }
//then when the players exit Turn it off public OnPlayerExitVehicle(playerid, vehicleid) { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective); return 1; }
the more COMPLEX way with the command /engine
which will keep the engine running when you EXIT the car if you turned the engine ON yourself
pawn Код:
//first the command //i dont know what u use CMD or the normal one so COMMAND:engine(playerid,params[]) { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); if(GetPVarInt(playerid, "engine")==1) { SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective); SetPVarInt(playerid, "engine", 0); SendClientMessage(playerid,0x0000FFFF,"Engine ON"); }else { SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective); SetPVarInt(playerid, "engine", 1); SendClientMessage(playerid,0x0000FFFF,"Engine Off"); } return 1; }
//When he Enters public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); if(GetPVarInt(playerid, "engine")==1) { SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective); SetPVarInt(playerid, "engine", 0); }else { SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective); SetPVarInt(playerid, "engine", 1); }
//When he Exits public OnPlayerExitVehicle(playerid, vehicleid) { new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective); if(GetPVarInt(playerid, "engine")==1) { SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective); SetPVarInt(playerid, "engine", 0); }else { SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective); SetPVarInt(playerid, "engine", 1); } } return 1; } // when he exits you don't really need it i think but just 2 make sure ;)
|