Fuel problem
#1

This tells me "You is not on amy gas startion" when i am ON the gas station
pawn Код:
dcmd_refill(playerid, params[])
{
    #pragma unused params
    if(!IsPlayerOnGasStation(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "You is not on amy gas startion");
    {
        RefillingTimer[playerid] = SetTimerEx("ReFuelTimer", 1000, true, "u", playerid);
        return 1;
    }
}
This tells me "You left the gas startion" when i am ON the gas station (Mayb other bugs there too?)
pawn Код:
public ReFuelTimer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new vehicleid = GetPlayerVehicleID(i);
        if(GetPlayerVehicleSeat(i) == 0)
        {
            if(IsPlayerOnGasStation(i))
            {
                if(Fuel[vehicleid] > 0)
                {
                    new lights, alarm, doors, bonnet, boot, objective;
                    SetVehicleParamsEx(vehicleid, true, lights, alarm, doors, bonnet, boot, objective);
                }
                else
                {
                    if(Fuel[vehicleid] == 100)
                    {
                        KillTimer(RefillingTimer[i]);
                        GameTextForPlayer(i,"~r~Tank Refilled", 5000, 4);
                        return 1;
                    }
                    else
                    {
                        Fuel[vehicleid] ++;
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(i, 0xFF0000FF, "You left the gas startion");
                KillTimer(RefillingTimer[i]);
                return 1;
            }
        }
    }
    return 1;
}
I think there is something wrong here then =/
pawn Код:
stock IsPlayerOnGasStation(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 10, 2115.5422, 919.5186, 10.8203)) return 0; //Gas Station 1
    return 1;
}
Reply


Messages In This Thread
Fuel problem - by Unknown123 - 17.03.2011, 20:59
Re: Fuel problem - by Kwarde - 17.03.2011, 21:01
Re: Fuel problem - by Unknown123 - 17.03.2011, 21:10
Re: Fuel problem - by Marricio - 17.03.2011, 21:13
Re: Fuel problem - by Unknown123 - 17.03.2011, 21:19
Re: Fuel problem - by Kwarde - 18.03.2011, 05:48

Forum Jump:


Users browsing this thread: 2 Guest(s)