Jump to content
  • 0

/fill


Mister

Question

Problemă întâlnită (descriere): Bunaziua am comanda de /fill (benzinarie) si /fillcar (canistra) si se incarca la maxim respectiv cat ai in canistra, as dori sa stiu cum pot face comenzile sa fie /fill 1 /fillcar 1 adica cati litri vreau eu
Ero(area / rile) / warning-(ul / urile): nu am warninguri
Liniile de cod / sursa / script-ul:

if(strcmp(cmd, "/fill", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsAtGasStation(playerid))
            {
                if(Gas[idcar] <= 99)
                {
                    TogglePlayerControllable(playerid, 0);
                    GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Re-Fueling Vehicle, please wait",2000,3);
                    SetTimer("Fillup",RefuelWait,0);
                    Refueling[playerid] = 1;
                }
                else
                {
                    GameTextForPlayer(playerid,"~r~~n~~n~~n~~n~~n~~n~~n~~n~~n~Gas can is full",2000,3);
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"** You're not at a Gas Station!");
            }
        }
        return 1;
    }

    if(strcmp(cmd, "/fillcar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pFuel] > 0)
            {
                if(Gas[gLastCar[playerid]] < 81)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "** You filled your car with 20 percent Fuel from your Gas Can.");
                    Gas[gLastCar[playerid]] += 20;
                    PlayerInfo[playerid][pFuel] = 0;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "** Your Car still got enough Fuel to drive with !");
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "** You have no Fuel left in your Gas Can !");
            }
        }
        return 1;
    }


Imagini / Video (optional):
Aţi încercat să rezolvaţi singur?: nu stiu cum sa incerc

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.