if(strcmp(cmd, "/fill", true) == 0)
{
new veh = GetPlayerVehicleID(playerid);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_YELLOW, "Du bist in Keinem Fahrzeug:");
if(IsANoTachoVehicle(veh))return SendClientMessage(playerid,COLOR_YELLOW," Ein Fahrrad hat doch keinen Tank.");
if(IsAtGasStation(playerid))
{
for(new i = 0; i < sizeof(TankstellenInfo); i ++)
{
if(IsPlayerInRangeOfPoint(playerid,10.0, TankstellenInfo[i][tsEntranceX], TankstellenInfo[i][tsEntranceY], TankstellenInfo[i][tsEntranceZ]))
{
if(GetPlayerMoney(playerid) < TankstellenInfo[i][tsEntranceCost])return GameTextForPlayer(playerid, "~r~Du hast nicht genug Geld", 5000, 1);
{
if(PlayerInfo[playerid][pPtankkey] != 0)
{
if(TankstellenInfo[i][tsLocked] == 1)return SendClientMessage(playerid,COLOR_RED, "Die Tanke hat geschlossen");
if(TankstellenInfo[i][tsProducts] == 5000)return SendClientMessage(playerid,COLOR_RED, "Die Tankstelle hat kein Benzin mehr");
if(Refueling[playerid] == 1)return SendClientMessage(playerid, COLOR_RED, "Du bist gerade am tanken...");
Refueling[playerid] = 1;
FreezePlayer(playerid);
SetTimerEx("Fillup",RefuelWait,0, "ii", playerid, i);
SendClientMessage(playerid,COLOR_WHITE," Dein Fahrzeug wird betankt, Bitte warten....");
}
}
}
}
}
}
else if(IsPlayerInRangeOfPoint(playerid,90.0, 78.8584, -291.3175, 1.5781))
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost2 = 50;
if(PlayerInfo[playerid][pJob] != 22)return SendClientMessage(playerid, COLOR_WHITE, "du bist kein Trucker");
if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /fill [Menge]");
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsATruck2(tmpcar))return SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Benzin ausliefern.");
if(!IsTrailerAttachedToVehicle(vehicleid))return SendClientMessage(playerid, COLOR_RED, "Du hast keinen anhänger dran");
new typ=GetPlayerHaul(tmpcar);
if(PlayerHaul2[typ][pLoad2] < PlayerHaul2[typ][pCapasity2])
{
new amount;
amount = strval(tmp);
if(amount < 1 || amount > 1500)return SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 1500 sein !");
new check= PlayerHaul2[typ][pLoad2] + amount;
if(check > PlayerHaul2[typ][pCapasity2])
{
format(string, sizeof(string), " Du hast das Limit mit %d Benzin erreicht, Benzin: %d.",PlayerHaul2[typ][pCapasity2],PlayerHaul2[typ][pLoad2]);
return SendClientMessage(playerid, COLOR_GREY, string);
}
new cost = amount*compcost2;
if(GetPlayerMoney(playerid) >= cost)
{
PlayerHaul2[typ][pLoad2] += amount;
format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Du hast %d Benzin für $%d gekauft.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
GivePlayerMoney(playerid,-cost);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
else
{
format(string, sizeof(string), "Du kannst nicht %d Benzin für $%d anfordern!", amount,cost);
return 1SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
else
{
format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
return SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
}
else
{
return SendClientMessage(playerid, COLOR_YELLOW,"Du bist an keiner Tankstelle!");
}
return 1;
}