Help please
#1

Hey guys, I got this command called /stealfuel it's working fine but I wonder how can I make it limited? Like that the gascan can only contain 20 fuel and can get the maximum out of a vehicle for example if the vehicle got 10 fuel that the gascan gains 10 fuel instead 20. I hope you get what I mean.
Here are the codes
pawn Код:
CMD:stealfuel(playerid, params[])
{
    if(PlayerInfo[playerid][pScrewdriver] == 1 && PlayerInfo[playerid][pCan] == 1 && PlayerInfo[playerid][pHosePipe] == 1)
    {
        new closestcar = GetClosestCar(playerid);
        if(IsPlayerNearVehicle(playerid, closestcar, 7.0))
        {
            if(Fuel[closestcar] == 0)
            {
                SendClientMessage(playerid, COLOR_YELLOW,"This vehicle is out of fuel.");
            }
            else if(Fuel[closestcar] > 0)
            {
                if(PlayerInfo[playerid][pCanFuel] == 20) return SendClientMessage(playerid, COLOR_YELLOW,"Your gascan is full.");
                PlayerInfo[playerid][pCanFuel] += ;
                Fuel[closestcar] -= ;
            }
        else
        {
        SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}You aren't near any vehicle.");
        }
    }
    else
    {
    SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}Make sure you got a gascan, hosepipe and a screwdriver in order to steal fuel.");
    }
    return 1;
}
Reply
#2

i dont understand good this but try this
pawn Код:
CMD:stealfuel(playerid, params[])
{
    if(PlayerInfo[playerid][pScrewdriver] == 1 && PlayerInfo[playerid][pCan] == 1 && PlayerInfo[playerid][pHosePipe] == 1)
    {
        new closestcar = GetClosestCar(playerid);
        if(IsPlayerNearVehicle(playerid, closestcar, 7.0))
        {
            if(Fuel[closestcar] == 0)
            {
                SendClientMessage(playerid, COLOR_YELLOW,"This vehicle is out of fuel.");
            }
            else if(Fuel[closestcar] > 0)
            {
                if(PlayerInfo[playerid][pCanFuel] == 100) return SendClientMessage(playerid, COLOR_YELLOW,"Your gascan is full.");
                PlayerInfo[playerid][pCanFuel] += ;
                Fuel[closestcar] -= ;
            }
        else
        {
        SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}You aren't near any vehicle.");
        }
    }
    else
    {
    SendClientMessage(playerid, COLOR_DARKRED,"[SERVER] {FFFFFF}Make sure you got a gascan, hosepipe and a screwdriver in order to steal fuel.");
    }
    return 1;
}
Reply
#3

Ah, no thats not what I really ment, I want the gas can to get the amount of fuel that the car contains. Here is the example: Lets say Sultan got 12 fuel and I got an empty gas can I use the cmd and my gascan will reach 12 fuel instead of 20
Reply
#4

aha now i understand but with this pwn code i think for can do this for what you want.
Reply
#5

The code just brings the limit up to 100 for the gascan, my limit is 20.
Reply
#6

Anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)