SA-MP Forums Archive
Help please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help please (/showthread.php?tid=445895)



Help please - RALL0 - 23.06.2013

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;
}



Re: Help please - Configuration - 23.06.2013

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;
}



Re: Help please - RALL0 - 23.06.2013

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


Re: Help please - Configuration - 23.06.2013

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


Re: Help please - RALL0 - 23.06.2013

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


Re: Help please - RALL0 - 23.06.2013

Anyone?