Help with Command to supply all cars
#7

pawn Код:
CMD:fillcars(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pMod] < 2 && PlayerInfo[playerid][pDono] < 2)
        return SendClientMessage(playerid,red,"| ERROR | You don't have permission!");

    new quantity;
    if(sscanf(params, "i", quantity)) return SendClientMessage(playerid, red, "Use: /fillcars [quantity]");
    if(!(0 < quantity <= 100)) return SendClientMessage(playerid, red, "| ERROR | The maximum amount of gas is 100!");
    new stringgas[68];
    format(stringgas, sizeof(stringgas), "AdmCmd: You supplied %d litres of fuel on all cars in San Andreas", quantity);
    SendClientMessage(playerid, blue, stringgas);
    for(new c = 1; c < MAX_VEHICLES; c++) carfuel[c] += quantity;
    return 1;
}
Normally I would subtract 1 when using a vehicle ID in an array, but I doubt you do this in your script. If I was to implement it here, you would have to change your entire script to fit the same way. So I'll just leave it how it is for now. This is just a small improvement on JaydenJason's code.
Reply


Messages In This Thread
Help with Command to supply all cars - by LucasDias - 09.06.2015, 14:02
Re: Help with Command to supply all cars - by Konstantinos - 09.06.2015, 14:04
Re: Help with Command to supply all cars - by LucasDias - 09.06.2015, 14:11
Re: Help with Command to supply all cars - by Richie© - 09.06.2015, 14:15
Re: Help with Command to supply all cars - by Konstantinos - 09.06.2015, 14:17
Re: Help with Command to supply all cars - by JaydenJason - 09.06.2015, 14:26
Re: Help with Command to supply all cars - by Threshold - 09.06.2015, 15:56
Re: Help with Command to supply all cars - by LucasDias - 09.06.2015, 17:00
Re: Help with Command to supply all cars - by Threshold - 09.06.2015, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)