No, I'm using this after a lot of modifications and adjustments (so I won't release it because it works only on my server). To fix it:
- replace whole OnPlayerCommandText with this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
if(strcmp(cmd, "/fill", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsAtGasStation(playerid))
{
// nдhste Tankstelle finden
new Float:olddistance = 999999;
new Float:newdistance;
new closest = -1;
new Float:GasX,Float:GasY,Float:GasZ;
for (new i = 0; i < sizeof(gGasStationLocations); i++)
{
GasX = gGasStationLocations[i][0];
GasY = gGasStationLocations[i][1];
GasZ = gGasStationLocations[i][2];
newdistance = GetDistanceBetweenPlayerToPoint(playerid,GasX,GasY,GasZ);
if (newdistance < olddistance)
{
olddistance = newdistance;
closest = i;
}
}
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Refuel! Please wait....",2000,3);
SetTimer("Fillup",RefuelWait,0);
gGasBiz[playerid] = closest+12;
Refueling[playerid] = 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY," You are not an a Gas Station!");
}
}
}
return 0;
}
- under OnFilterScriptInit replace
pawn Код:
BenzinUpdatetimer = SetTimer("BenzinUpdate", 1, 1);
with:
pawn Код:
BenzinUpdatetimer = SetTimer("BenzinUpdate", 1000, 1);
(1ms timer X/ WTF man?)
Then it should work KINDA correctly (there are more bugs...) If commands are still bugged, tell me.