25.03.2009, 13:26
Ok I'll try it later, I hope it'll work...
EDIT: I'll fixed it, dunno what helped but now callback looks like that:
Thanks for your help!
EDIT: I'll fixed it, dunno what helped but now callback looks like that:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fill", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsAtGasStation(playerid))
{
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;
return 1;
}
return 1;
}
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Refueling! Please wait...");
SetTimer("Fillup",RefuelWait,0);
gGasBiz[playerid] = closest+12;
Refueling[playerid] = 1;
return 1;
}
SendClientMessage(playerid,COLOR_GREY,"You are not an a Gas Station!");
return 1;
}
return 1;
}
return 0;
}