Hey,
Wenn man tankt bassiert momentan Nichts
if(strcmp(cmd, "/tanken", true) == 0 || strcmp(cmd, "/tankcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new b = 0; b < sizeof(TankeInfo); b++)
{
if(IsPlayerInRangeOfPoint(playerid,5.0, TankeInfo[b][tEntranceX], TankeInfo[b][tEntranceY], TankeInfo[b][tEntranceZ]))
{
if(IsANoTachoVehicle(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid,COLOR_GRAD1,"Du kannst dein Fahrrad nicht Auftanken!");
}
else
{
SetTimer("Fillup",RefuelWait,0);
Refueling[playerid] = 1;
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid,COLOR_WHITE,"Dein Fahrzeug wird betankt, bitte warten...");
format(string, sizeof(string), "UserCMD: %s Tankt an einer Tankstelle auf (/fill).", PlayerName(playerid));
ABroadCast(COLOR_LIGHTRED,string, 5);
}
}
else
{
//SendClientMessage(playerid,COLOR_GREY,"Du bist an keiner Tankstelle!");
//return 1;
}
}
}
return 1;
}
Der Enum
enum tInfo
{
tOwned,
tOwner[64],
tMessage[128],
tExtortion[MAX_PLAYER_NAME],
Float:tEntranceX,
Float:tEntranceY,
Float:tEntranceZ,
tLevelNeeded,
tBuyPrice,
tEntranceCost,
tTill,
tLocked,
tInterior,
tProducts,
tMaxProducts,
tPriceProd,
};
Timer
public Fillup()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new VID;
new FillUp;
//new FillUpRandom = random(250)+1;
new string[256];
VID = GetPlayerVehicleID(i);
FillUp = GasMax - Gas[VID];
for(new b = 0; b < sizeof(TankeInfo); b++)
{
if(IsPlayerInRangeOfPoint(i,5.0, TankeInfo[b][tEntranceX], TankeInfo[b][tEntranceY], TankeInfo[b][tEntranceZ]))
{
if(Refueling[i] == 1)
{
if(GetPlayerMoney(i) >= FillUp+4)
{
Gas[VID] += FillUp;
FillUp = FillUp * TankeInfo[b][tEntranceCost];
format(string,sizeof(string),"* Du hast dein Fahrzeug für $%d aufgetankt.",FillUp);
SendClientMessage(i,COLOR_LIGHTBLUE,string);
TogglePlayerControllable(i, 1);
TogglePlayerControllable(i, 1);
GivePlayerMoney(i, - FillUp);
TankeInfo[b][tTill] += FillUp;
/// TankeInfo[b][tTill] += FillUpRandom;
TankeInfo[b][tExtortion] += FillUp;
// TankeInfo[b][tExtortion] += FillUpRandom;
Refueling[i] = 0;
// SBizzInfo[3][sbTill] += FillUp; //inhaber
// SBizzInfo[3][sbExtortion] += FillUpRandom; //mitinhaber
}
else
{
TogglePlayerControllable(i, 1);
new cost = TankeInfo[b][tEntranceCost];
format(string,sizeof(string),"* Nicht genug Geld zum Auffüllen, du benötigst $%d zum Auffüllen deines Autos.",cost);
SendClientMessage(i,COLOR_LIGHTBLUE,string);
}
}
}
}
}
}
return 1;
}
Koordinaten der Tankstellen
public LoadTanke()//(c)SRP-team
{
new arrCoords[16][64];
new strFromFile2[256];
new File: file = fopen("fuelstations.cfg", io_read);
if (file)
{
new idx;
while (idx < sizeof(TankeInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
TankeInfo[idx][tOwned] = strval(arrCoords[0]);
strmid(TankeInfo[idx][tOwner], arrCoords[1], 0, strlen(arrCoords[1]), 255);
strmid(TankeInfo[idx][tMessage], arrCoords[2], 0, strlen(arrCoords[2]), 255);
strmid(TankeInfo[idx][tExtortion], arrCoords[3], 0, strlen(arrCoords[3]), 255);
TankeInfo[idx][tEntranceX] = floatstr(arrCoords[4]);
TankeInfo[idx][tEntranceY] = floatstr(arrCoords[5]);
TankeInfo[idx][tEntranceZ] = floatstr(arrCoords[6]);
TankeInfo[idx][tLevelNeeded] = strval(arrCoords[7]);
TankeInfo[idx][tBuyPrice] = strval(arrCoords[8]);
TankeInfo[idx][tEntranceCost] = strval(arrCoords[9]);
TankeInfo[idx][tTill] = strval(arrCoords[10]);
TankeInfo[idx][tLocked] = strval(arrCoords[11]);
TankeInfo[idx][tInterior] = strval(arrCoords[12]);
TankeInfo[idx][tProducts] = strval(arrCoords[13]);
TankeInfo[idx][tMaxProducts] = strval(arrCoords[14]);
TankeInfo[idx][tPriceProd] = strval(arrCoords[15]);
idx++;
}
fclose(file);
}
return 1;
}
Die Datei auf die zugegriffen wird
3849.750 -865.981 577.520 0 !Unknown?Unknown! 99 99 0 25
1003.674 -941.687 42.083 1 John_Marijuana 1000000 5 351800 100
1946.270 -1773.406 12.951 0 EvGeNy.eXe 850000000 98 3611100 100
-1606.614 -2713.798 48.533 1 de.ruededuede 1 1 16900 25
655.565 -564.848 15.906 0 Thechoose.Powner 800000000 99 539539608 100
1109.348 -309.053 73.527 1 Leoni_Garcia 99 5 400235234 22
2115.760 920.518 10.819 1 DeLuEx 700000000 99 3375 25
1598.869 2200.031 10.819 0 xMomochii_AntiVir 10000000 99 3050 25
1547.301 -1609.357 13.380 1 Trace 50 5 40802511 100
608.525 1699.212 6.559 0 GTA_Kevin 500000000 99 40000096 24
-2407.437 974.755 45.296 0 VeNoX 650000000 99 95425 25
618.455 1684.442 6.992 0 Furkan.XxX 500000000 99 1000 25
-1675.468 413.953 6.743 0 CrunK_Bang 700000000 99 600092800 25
-1470.561 1864.357 32.337 1 PaoLo_LucareLLi 1 1 630 15
-1329.009 2677.135 49.763 0 kaLL1.Powner 400000000 99 7010850 25
-737.018 2742.885 46.902 0 Ex0rZiSt 10000000 99 0 50
-2023.729 156.266 28.833 0 Josh_Gerilla 10000000 99 474221080 100
70.331 1220.276 18.809 1 Capo_Marijuana 1 1 1800019549 100
2201.987 2474.197 10.390 0 DeLuEx 700000000 99 25865 0
1381.052 457.173 19.923 0 Alvaro_Garcia 25000000 99 68000 100
2281.153 2431.802 3.273 1 LeXuS 1 1 141325 90
1991.045 -2371.604 13.545 0 Funny_Galibri 100000000 99 57525900 25
2741.060 -2392.177 13.630 1 HeInZ.eXe 1 1 1962884323 88
737.903 -1334.062 13.541 1 Ganja_Marijuana 1 10 1355459 100
-1987.519 305.730 35.179 0 Zero_Martinez 10000000 99 29868125 25
-1351.953 454.868 6.736 1 Dr.Tube 1 1 121990 35
-90.430 -1167.796 2.423 1 Alex16 1 1 60900 100
2641.245 1107.125 10.819 0 LecTroKinQ 10000000 99 1013030 20
262.906 -2586.707 2.430 1 Bevis 1 1 1000 100
-2115.364 -114.222 35.319 1 Stefan_RGR 1 1 7275 25
Alles anzeigen