Hey Com,
in meinem Motor Befehl geht der motor tritzdem an obwohl ich autohauscars ne extra Abfrage gemacht ahbe?
if(strcmp(cmd, "/e",true) == 0 || strcmp(cmdtext,"/engine",true) == 0)
{
for(new veh = 0; veh < sizeof(PolizeiVehs); veh++)
{
new vid = GetPlayerVehicleID(playerid);
if(Gas[vid] != 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
new mane[MAX_PLAYER_NAME];
new sendname = GetPlayerName(playerid,mane,sizeof(mane));
if(IsADtCar(vid))
{
for(new i=0; i<MAX_PLAYERS; i++)
{
for(new i2 = 0; i2 < MaxVeh; i2++)
{
if(PlayerCar[i][i2][Abgeschleppt] == 0)
{
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "*%s stellt den Motor von seinem Fahrzeug ab.", sendname);
ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SetTimerEx("motoran",1000,0, "i", playerid);
format(string, sizeof(string), "*%s lässt den Motor von seinem Fahrzeug an.", sendname);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
SendClientMessage(playerid,WHITE,"Das Fahrzeug für diesen Schlüssel wurde abgeschleppt!");
return 1;
}
}
}
}
else if(GetPlayerVehicleID(playerid) == autohauscars[veh])
{
SendClientMessage(playerid,WHITE,"Dieses Fahrzeug ist eigentum der Ottocar GmBH!");
return 1;
}
else if(vid != INVALID_VEHICLE_ID)
{
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
format(string, sizeof(string), "*%s stellt den Motor von seinem Fahrzeug ab.", sendname);
ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
//SendClientMessage(playerid, COLOR_LIGHTBLUE,"Du lässt den Motor an...");
SetTimerEx("motoran",1000,0, "i", playerid);
format(string, sizeof(string), "*%s lässt den Motor von seinem Fahrzeug an.", sendname);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
else
{
SendClientMessage(playerid,COLOR_PURPLE,"Dein Tank ist leer, rufe das Oamt oder eine Mechaniker!");
return 1;
}
return 1;
}
}
Danke auf mithilfe
Mfg
Edit Motorbefhl ganz