Jump to content
  • 0

Question

Posted

Nick:fytza

Problema: comanda /fuelcarsfactions . cand leaderul foloseste comanda.... sa dea fuel la toate masinile ;)

Erori / warnings:-

Lini/script:-

Ai incercat sa rezolvi singur ?:da

4 answers to this question

Recommended Posts

  • Administrator
Posted

Si comanda pentru /fuel? Sa vedem ce variabila ai pentru fuel-ul masinii.

Posted

[pawn] if(strcmp(cmd, "/fuelcars", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerData[playerid][pAdmin] >= 3)

        {

            for(new c=0;c<CAR_AMOUNT;c++)

{

Gas[c] = GasMax;

}

SendClientMessage(playerid, COLOR_GREY, "Toate masinile au fost umplute cu benzina ! ");

        }

        else

        {

            SendError(playerid,cmd);

            return 1;

        }

    }

    return 1;

}[/pawn]

[pawn] if(strcmp(cmd, "/fill", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendUsage(playerid,"/fill [numar litri]");

return 1;

}

moneys = strval(tmp);

new vid;

  new FillUpp;

    vid = GetPlayerVehicleID(playerid);

    FillUpp = GasMax - Gas[vid];

            if(FillUpp < moneys || moneys <= 0)

    {

SendClientMessage(playerid,COLOR_LIGHTRED,"ServeR: Ne pare rau, nu poti introduce in rezervor litri de benzina doriti.");

        return 1;

}

        if(GetPlayerCash(playerid) < moneys * SBizzData[3][sbEntranceCost])

{

  SendClientMessage(playerid, COLOR_LIGHTBLUE, "{DBED15}Angajat peco:{15D4ED} Nu ai destui bani, pentru a achita benzina.");

    return 1;

        }

        GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);

if(engine == 1)

{

    SendClientMessage(playerid, COLOR_LIGHTBLUE, "{DBED15}Angajat peco:{15D4ED} Nu alimentam masinile cu motorul in functiune.");

    return 1;

}

if(IsAtGasStation(playerid))

{

    GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Alimentare masina, te rugam asteapta...",2000,3);

SetTimerEx("Fillup", RefuelWait, false, "i", playerid);

Refueling[playerid] = 1;

CaridRefuel[playerid] = vid;

RefuelPrice[playerid] = moneys * SBizzData[3][sbEntranceCost];

RefuelLitri[playerid] = moneys;

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Nu esti intr-o benzinarie!");

}

}

    return 1;

}[/pawn]

[pawn] if(strcmp(cmd, "/fillcar", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    if(PlayerData[playerid][pFuel] > 0)

    {

        if(Gas[GetPlayerVehicleID(playerid)] < 81)

        {

        SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai bagat 20% benzina in rezervor din canistra ta");

        Gas[GetPlayerVehicleID(playerid)] += 20;

        PlayerData[playerid][pFuel] = 0;

        format(string, sizeof(string), "UPDATE players SET Fuel='%d' WHERE id=%d", PlayerData[playerid][pFuel], PlayerData[playerid][pSQLID]);

mysql_query(string);

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "Benzina masini tale este peste 80%!");

}

    }

    else

    {

        SendClientMessage(playerid, COLOR_GREY, "Nu ai benzina in canistra!");

    }

}

return 1;

}[/pawn]

  • Administrator
Posted

[PAWN]if(strcmp(cmd, "/fuelcarsfactions", true) == 0)

    {

        if(IsPlayerConnected(playerid))

        {

            if(PlayerData[playerid][pLeader] == 1)

            {

                for(new c = ID MASINA DE INCEPUT PENTRU FACTIUNEA 1;c < ID DE SFARSIT PENTRU FACTIUNEA 1 SI IL ADUNI CU 1; c++)

                    Gas[c] = GasMax;

                SendClientMessage(playerid, COLOR_GREY, "Toate masinile au fost umplute cu benzina ! ");

            }

            else

                return SendError(playerid,cmd);

        }

        return 1;

    }[/PAWN]

De ce nu incerci sa te uiti sa vezi ce trebuie schimbat?

Posted

Nu ai raspuns in termen de 48 de ore.Topic inchis!

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Guest
This topic is now closed to further replies.
×
×
  • 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.