Refueling vehicles
#2

pawn Код:
if(strcmp(cmd, "/fuel", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new vid = GetPlayerVehicleID(playerid);
            if(IsAtGasStation(playerid) && VehicleInfo[vid][pEngineStatus] == 0)
            {
                ShowPlayerDialog(playerid,291,DIALOG_STYLE_LIST,"Добро пожаловать на заправку!Выберите тип топлива:","Дизель\nAИ 90\nAИ 93\nAИ 95","Выбрать","Отмена");
            }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"[Сервер]: Вы не на АЗС!");
            }
        }
        return true;
    }
So, if
pawn Код:
VehicleInfo[vid][pEngineStatus] = 1;
the function that says it's off must be/probably is
pawn Код:
VehicleInfo[vid][pEngineStatus] = 0;
so you only have to add it in the function that's limiting the use of the cmd, which in this case is
pawn Код:
f(IsAtGasStation(playerid)
That way, you must add the function that says the engine is turned off together with the one that says if the player is in a gas station, so you use
pawn Код:
if(IsAtGasStation(playerid) && VehicleInfo[vid][pEngineStatus] == 0)
&& = and

you'll probably have to get the vehicle's id, so use
pawn Код:
new vid = GetPlayerVehicleID(playerid);
Reply


Messages In This Thread
Refueling vehicles - by Vlad_Dredd - 16.10.2013, 07:45
Re: Refueling vehicles - by LeMoi - 16.10.2013, 09:43
Re: Refueling vehicles - by Vlad_Dredd - 16.10.2013, 12:39

Forum Jump:


Users browsing this thread: 1 Guest(s)