public BenzinVerlust()
{
for(new i=0; i<MAX_VEHICLES; i++)
{
if (Motor[i] == true)
{
Tank[i] = Tank[i]-1;
if (Tank[i]<1)
{
Tank[i] = 0;
new c = GetPlayerVehicleID(i);
GetVehicleParamsEx(c,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(c,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Motor[i] = false;
}
}
}
return 1;
}
if(strcmp(cmdtext, "/tanken", true) == 0)
{
if (GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid,Color_Red,"Du bist in keinem Fahrzeug (oder kein Fahrer).");
new car = GetPlayerVehicleID(playerid);
if (TanktGerade[car]) return SendClientMessage(playerid,Color_Red,"Du tankst schon!");
else if (Motor[car] == true) return SendClientMessage(playerid,Color_Red,"Du musst vor dem Tanken den Motor ausschalten.");
new ZuTanken = 100-Tank[car];
new preis = ZuTanken * BENZINPREIS;
if (GetPlayerMoney(playerid)-preis < 0) return SendClientMessage(playerid,Color_Red,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -preis);
SendClientMessage(playerid, Color_Red, "Tanken wird gestartet.");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
TanktGerade[car] = true;
tanktimer[playerid] = SetTimerEx("Auftanken",500,true,"i",playerid);
return 1;
}