Motor mit Z Taste An und Aus
Mit Z Taste an ist schon vorhanden
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(pInfo[playerid][Refueling]==1)
{
if((newkeys&KEY_HANDBRAKE)&&!(oldkeys&KEY_HANDBRAKE)) //Detecting if key for hanadbrake is pressed and holded
{
Refuelupdate[playerid]=SetTimerEx("RefuelUpdateTimer",RefuelUpdate,1,"i",playerid);
}
if((oldkeys&KEY_HANDBRAKE)&&!(newkeys&KEY_HANDBRAKE)) //Detecting if key for handbreak got released
{
KillTimer(Refuelupdate[playerid]);
SendClientMessage(playerid,-1,"Zum beenden des tankens gebe /endetanken ein!");
}
}
if((newkeys&KEY_YES)&&!(oldkeys&KEY_YES))
{
if(pInfo[playerid][EngineOn]==0&&pInfo[playerid][Refueling]!=1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),1, lights, alarm, doors, bonnet, boot, objective);
pInfo[playerid][EngineOn]=1;
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
pInfo[playerid][VehIDOld]=GetPlayerVehicleID(playerid);
KillTimer(Speedoupdate[playerid]);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid,0, lights, alarm, doors, bonnet, boot, objective);
return 1;
}