Should return a value
#8

Change your CMD to this:
Код:
CMD:pylti(playerid, params[])
{
    for(new i=1; i < MAX_FUEL_STATIONS; i++)
    {
        if(FuelStationCreated[i])
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(IsEngineRunning(vehicleid) == 1) return SendClientMessage(playerid, COLOR_RED, "Isjunkite varikli pries pildami kura!");
            if(IsPlayerInRangeOfPoint(playerid, 15.0, FuelStationPos[i][0], FuelStationPos[i][1], FuelStationPos[i][2]))
            {
                SetPVarInt(playerid, "FuelStation", i);
                ShowDialog(playerid, DIALOG_FUEL);
                return 1;
            }
        }
    }
    SendClientMessage(playerid, COLOR_RED, "You are not in a fuel station!");
    return 1;
}
Replace your ToggleEngine function with this:
Код:
stock IsEngineRunning(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    return engine;
}
Reply


Messages In This Thread
Should return a value - by Dziugsas - 11.04.2014, 13:45
Re: Should return a value - by Konstantinos - 11.04.2014, 13:51
Re: Should return a value - by Dziugsas - 11.04.2014, 13:51
Re: Should return a value - by BroZeus - 11.04.2014, 13:52
Re: Should return a value - by Dziugsas - 11.04.2014, 13:55
Re: Should return a value - by Konstantinos - 11.04.2014, 13:57
Re: Should return a value - by Dziugsas - 11.04.2014, 14:00
Re: Should return a value - by Conradus - 11.04.2014, 14:13

Forum Jump:


Users browsing this thread: 3 Guest(s)