Problem with Kane_Phoenix's fuel system
#4

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:

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;
}
Thanks for your help!
Reply


Messages In This Thread
Problem with Kane_Phoenix's fuel system - by DiDok - 24.03.2009, 18:50
Re: Problem with Kane_Phoenix's fuel system - by jat1801 - 24.03.2009, 23:48
Re: Problem with Kane_Phoenix's fuel system - by ICECOLDKILLAK8 - 24.03.2009, 23:50
Re: Problem with Kane_Phoenix's fuel system - by DiDok - 25.03.2009, 13:26

Forum Jump:


Users browsing this thread: 1 Guest(s)