23.06.2013, 15:39
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
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;
}