09.02.2012, 19:36
So, I am using the EXACT same way for /enter
But with /refuel it tells me im not near a gas station
But with /refuel it tells me im not near a gas station
pawn Код:
CMD:refuel(playerid, params[])
{
if (IsPlayerInAnyVehicle(playerid))
{
if (isrefuelling[playerid] == 0)
{
for(new h = 0; h < sizeof(BizzInfo); h++)
{
format(file6, sizeof(file6), "realityrp/bizzes/%d.ini", h);
BizzInfo[h][benx] = dini_Float(file6, "benx");
BizzInfo[h][beny] = dini_Float(file6, "beny");
BizzInfo[h][benz] = dini_Float(file6, "benz");
if(IsPlayerInRangeOfPoint(playerid, 15, dini_Float(file6, "benx"), dini_Float(file6, "beny"), dini_Float(file6, "benz")))
{
if(BizzInfo[h][bprods] >= 5)
{
if(GetPlayerMoney(playerid) >= BizzInfo[h][bfee])
{
if(BizzInfo[h][btype] == 7)
{
GivePlayerMinusCash(playerid,BizzInfo[h][bfee]);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);refuel at the same time
isrefuelling[playerid] = 1; /refuel
TextDrawSetString(td_fuel[playerid],"Refuelling..."); /refuel
SetTimerEx("timer_refuel",4500,false,"i",playerid);
BizzInfo[h][bprods] = BizzInfo[h][bprods] - 5;
BizzInfo[h][bbank] = BizzInfo[h][bbank] + BizzInfo[h][bfee];
BizzInfo[h][customers] = BizzInfo[h][customers] + 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not at a Gass Station!");
}
else return SendClientMessage(playerid, COLOR_GREY, "Not enough money!");
}
else return SendClientMessage(playerid, COLOR_GREY, "Gas station is empty! A petrol trucker is needed to refill!");
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not at a gas station!");
}
return 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "You are already refueling!");
}
else return SendClientMessage(playerid, COLOR_GREY, "You must be in a vehicle to do this!");
}