CMD:refuel(playerid, params[])
{
if (IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFC800FF,"SERVER: You can not refuel a vehicle from the inside.");
new engine, lights, alarm, doors, bonnet, boot, objective;
new veh = GetClosestVehicle(playerid, 5.0);
if(IsPlayerInRangeOfPoint(playerid, 5.0, 572.5297+11400,-2759.7271-10000,13.9872) && IsPlayerInRangeOfPoint(playerid, 5.0, 12368.1885,-11937.6396,5.5338) && IsPlayerInRangeOfPoint(playerid, 5.0, 12368.8154,-11943.2422,5.5425) && IsPlayerInRangeOfPoint(playerid, 5.0, 12371.4863,-11948.7529,5.5312) && IsPlayerInRangeOfPoint(playerid, 5.0, 12365.1885,-11938.9287,5.5332))
{
if(!IsPlayerNearAnyVehicle(playerid, 5.0) && PlayerInfo[playerid][pFuelCan] == 1 && PlayerInfo[playerid][pCanFuel] < 100)
{
SetTimerEx("RefuelingCan2", 20000, 0, "i", playerid);
GameTextForPlayer(playerid, "Refueling!", 17000, 1);
TogglePlayerControllable(playerid, 0);
SetCameraBehindPlayer(playerid);
return 1;
}
if(IsPlayerNearAnyVehicle(playerid, 5.0))
{
if(owner[veh] == -1) return ERROR(playerid, "SERVER: You can't refill this vehicle!");
if (fuel[veh] == 100) return SendClientMessage(playerid,0xFFC800FF,"SERVER: You're vehicle is full, you can't refuel it.");
GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(veh, 1, lights, alarm, doors, bonnet, boot, objective);
SetTimerEx("Refueling", 20000, 0, "id", playerid, veh);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Refueling!", 17000, 1);
SetCameraBehindPlayer(playerid);
return 1;
}
}
else if(PlayerInfo[playerid][pFuelCan] == 1)
{
if(PlayerInfo[playerid][pCanFuel] < 1) return SCM(playerid, COLOR_WHITE, "SERVER: Your fuel can is empty, refill it at the gas station.");
if(owner[veh] == -1) return ERROR(playerid, "SERVER: You can't refill this vehicle!");
if (fuel[veh] == 100) return SendClientMessage(playerid,0xFFC800FF,"SERVER: You're vehicle is full, you can't refuel it.");
GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(veh, 1, lights, alarm, doors, bonnet, boot, objective);
SetTimerEx("RefuelingCan", 20000, 0, "id", playerid, veh);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid, "Refueling!", 17000, 1);
SetCameraBehindPlayer(playerid);
return 1;
}
else
{
SCM(playerid, COLOR_WHITE, "SERVER: You need to be near a gas station or have a fuel can in order to use this command.");
}
new str[128];
format(str, sizeof(str), "%s has issued the /refuel command.", GetName(playerid));
Log("logs/playercmds/veh.log", str);
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, 572.5297+11400,-2759.7271-10000,13.9872) && IsPlayerInRangeOfPoint(playerid, 5.0, 12368.1885,-11937.6396,5.5338) && IsPlayerInRangeOfPoint(playerid, 5.0, 12368.8154,-11943.2422,5.5425) && IsPlayerInRangeOfPoint(playerid, 5.0, 12371.4863,-11948.7529,5.5312) && IsPlayerInRangeOfPoint(playerid, 5.0, 12365.1885,-11938.9287,5.5332))
if(IsPlayerInRangeOfPoint(playerid, 5.0, 572.5297+11400,-2759.7271-10000,13.9872) || IsPlayerInRangeOfPoint(playerid, 5.0, 12368.1885,-11937.6396,5.5338) || IsPlayerInRangeOfPoint(playerid, 5.0, 12368.8154,-11943.2422,5.5425) || IsPlayerInRangeOfPoint(playerid, 5.0, 12371.4863,-11948.7529,5.5312) || IsPlayerInRangeOfPoint(playerid, 5.0, 12365.1885,-11938.9287,5.5332))
|
I believe
PHP Code:
You might meant to do this way if player is in either of these range PHP Code:
|
.