19.10.2015, 18:48
Are you using gamemode to make a engine system?
Try this..
Try this..
PHP код:
#include <a_samp>
#include <zcmd>
public OnFilterScriptInit() // Use it as filterscript instead..
{
ManualVehicleEngineAndLights();
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vehicleid = GetPlayerVehicleID(playerid);
if (vehicleid) {
if ((newkeys & KEY_SUBMISSION) && GetPlayerVehicleSeat(playerid) == 0)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if (engine == 0) engine = 1;
else engine = 0;
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
return 1;
}
}
return 1;
}
CMD:engine(playerid,params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective;
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle's engine is now turned [ON].");
}
else
{
//Send a message telling he is not in a vehicle to manipulate an engine
}
return 1;
}