SA-MP Forums Archive
/refuel cmd scrpting - 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: /refuel cmd scrpting (/showthread.php?tid=329687)



/refuel cmd scrpting - kollkill - 29.03.2012

How do i do it?


Re: /refuel cmd scrpting - doreto - 29.03.2012

why you dont just download fuel firescript


Re: /refuel cmd scrpting - Nicholas. - 29.03.2012

There are some simple tutorials around the forums you can find to help you.


Re: /refuel cmd scrpting - BigD - 29.03.2012

Something like?

pawn Код:
CMD:refuel(playerid, params[]) {
   new amount;
if(!sscanf(params,"d",amount)) {
if(IsPlayerInAnyVehicle))
if(playerVariables[playerid][pFuel] >= 99) {
playerVariables[playerid][pFuel] = amount;
                   }
           }
       return 1;
}
this was done in a web browser


Re: /refuel cmd scrpting - Avi57 - 30.03.2012

Try This:
Код:
if(strcmp(cmdtext, "/refuel", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 2005.6378,-2453.3921,13.5469))
        {
            if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFF00AA, "You must be in a vehicle to use this command!");
            if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFF00AA, "You don't have enough cash to refuel your vehicle!");
            SendClientMessage(playerid, -1, "Your vehicle has been refilled!");
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000, "You must be at the Red Flag to use this command!");
        }
        return 1;
    }
    return 1;
}
Put this under:
Код:
public OnPlayerCommandText(playerid, cmdtext[])