ManualVehicleEngineAndLights();
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
CMD:engine(playerid, params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(Engine[vehicleid] == 0) // change this to your engine variable.
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOUR_HERE, "The engine of this vehicle has been turned on.");
}
else if(Engine[vehicleid] == 1) // change this to your engine variable.
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOUR_HERE, "The engine of this vehicle has been turned off.");
}
}
else return SendClientMessage(playerid, COLOUR_HERE, "You must be in a vehicle to use this command.");
return 1;
}
CMD:engineon(playerid, params)
{
if(IsPlayerInAnyVehicle(playerid))
{
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if( engine = 0)
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
else return SendClientMessage(playerid, -1, "Your Vehicle's Engine Is Already On.");
}
else return SendClientMessage(playerid, -1, "You Need to Be In A Vehicle To Use This Command");
}
pawn Код:
|
new engine, lights, alarm, doors, bonnet, boot, objective, vehicleid = GetPlayerVehicleID(playerid); GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective); |