Engine System:
if(!strcmp(cmd, "/engine", true))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(!engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsADrugHarvest(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
if(gEngine[playerid] == 1) { return 1; }
new playerveh = GetPlayerVehicleID(playerid);
PutPlayerInVehicle(playerid, playerveh, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s versucht den Motor zu starten.", sendername);
ProxDetector(30.0, playerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
SetTimerEx("StartingTheVehicle",10,0,"i",playerid);
GameTextForPlayer(playerid, "~w~der Motor startet",10,3);
gEngine[playerid] = 1;
return 1;
}
if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey2] == idcar) { }
else if(PlayerInfo[playerid][pPcarkey3] == idcar) { }
else { return 1; }
}
if(pveh == 510 || pveh == 462 || pveh == 481 || pveh == 509)
{
return 1;
}
if(idcar == 59 || idcar == 60)
{
return 1;
}
if(idcar >= 135 && idcar <= 154)
{
if(HireCar[playerid] != idcar)
{
return 1;
}
}
if(IsAHarvest(idcar))
{
return 1;
}
if(IsADrugHarvest(idcar))
{
return 1;
}
if(IsAPlane(idcar))
{
return 1;
}
if(IsASweeper(idcar))
{
return 1;
}
engineOn[GetPlayerVehicleID(playerid)] = false;
//RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s schaltet den Motor ab.", sendername);
ProxDetector(30.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
gEngine[playerid] = 0;
/* new keycar = PlayerInfo[playerid][pPcarkey];
new keycar2 = PlayerInfo[playerid][pPcarkey2];
new keycar3 = PlayerInfo[playerid][pPcarkey3];
if(IsAnOwnableCar(idcar))
{
if(keycar == idcar)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
GameTextForPlayer(playerid, "~w~Vehicle~n~~r~Auto-Locked", 10000, 3);
CarInfo[keycar][cLock] = 1;
}
}
else if(keycar2 == idcar)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar2,i,0,1);
}
GameTextForPlayer(playerid, "~w~Vehicle~n~~r~Auto-Locked", 10000, 3);
CarInfo[keycar2][cLock] = 1;
}
}
else if(keycar3 == idcar)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar3,i,0,1);
}
GameTextForPlayer(playerid, "~w~Vehicle~n~~r~Auto-Locked", 10000, 3);
CarInfo[keycar3][cLock] = 1;
}
}
}*/
return 1;
}
}
}
return 1;
}
von wem wieß ich nicht mehr sry