#define Tankstellen 11
enum TankstellenEnum
{
Float:TankeX,
Float:TankeY,
Float:TankeZ,
};
new TankstellenCoords[Tankstellen][TankstellenEnum] = {
{1003.2424,-939.8856,42.1797},
{1943.7170,-1770.8899,13.1202},
{-91.9763,-1169.1646,2.1538},
{-1676.4634,413.4637,6.9068},
{-2413.3281,975.9434,45.0249},
{-1328.4108,2677.6746,50.0625},
{616.2668,1690.2572,6.9922},
{1596.4333,2199.7446,10.8203},
{2146.6416,2748.0005,10.8203},
{2114.7175,920.2508,10.8203},
{-1605.9790,-2714.2974,48.5335}
};
OnGameModeInit
for(new o = 0; o < Tankstellen; o++) {
AddStaticPickup(1239, 23, TankstellenCoords[o][TankeX],TankstellenCoords[o][TankeY],TankstellenCoords[o][TankeZ], 0);
Create3DTextLabel("[Tankstelle]\nZum tanken ,'/tanken' tippen",FARBE_Gelb,TankstellenCoords[o][TankeX],TankstellenCoords[o][TankeY],TankstellenCoords[o][TankeZ], 30.0,0,1);
}
/tanken
ocmd:tanken(playerid)
{
if(Eingeloggt[playerid] == 0) { return 1; }
for(new o = 0; o < Tankstellen; o++) {
if(!IsPlayerInRangeOfPoint(playerid, 20.0, TankstellenCoords[o][TankeX],TankstellenCoords[o][TankeY],TankstellenCoords[o][TankeZ])) {
SendInfoMsg(playerid, "Du bist an keiner Tankstelle!");
return 1;
}
}
if (GetPlayerVehicleSeat(playerid) != 0) return SendClientMessage(playerid,FARBE_Rot,"Du bist in keinem Fahrzeug (oder kein Fahrer).");
new car = GetPlayerVehicleID(playerid);
if (TanktGerade[car]) return SendInfoMsg(playerid, "Du tankst schon!");
if (Motor[car] == true) return SendInfoMsg(playerid, "Du musst vor dem Tanken den Motor ausschalten.");
new ZuTanken = 100-Tank[car];
new preis = ZuTanken * BENZINPREIS;
if (Spieler[playerid][Geld]-preis < 0) return SendClientMessage(playerid,FARBE_Grad2,"Du hast nicht genug Geld!");
Spieler[playerid][Geld] -= preis;
SendClientMessage(playerid, FARBE_Gruen, "Tanken wird gestartet.");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
TanktGerade[car] = true;
tanktimer[playerid] = SetTimerEx("Auftanken",500,true,"i",playerid);
return 1;
}
So jedes mal wenn ich jetzt /tanken eingebe, steht da: "Du bist an keiner Tankstelle"
Aber egal wo ich das mache