if(strcmp(cmdtext,"/Motor", true) == 0)
{
new Float:health;
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,health);
if(health >= 300)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new cveh = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid) &&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER))
{
if(cveh != INVALID_VEHICLE_ID)
{
if(EngineStatus[playerid] == 0)
{
GetVehicleParamsEx(cveh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(cveh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
EngineStatus[playerid] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s betätigt die Zündung. Der Motor springt an.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
gGas[playerid] = 1;
}
else if(EngineStatus[playerid] == 1)
{
GetVehicleParamsEx(cveh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(cveh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
EngineStatus[playerid] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s schaltet den Motor ab.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
gGas[playerid] = 1;
}
}
}
else {
SendClientMessage(playerid, COLOR_RED, "Sie befinden sich in keinem Fahrzeug.");
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"Ihr Fahrzeug hat einen Motorschaden, rufen sie einen ADAC.");
}
}