Help on my Refuel!
#1

Hey guys, i try to /refuel my car but the deduction of money is non stop? How to fix it? Help.

Here is my code.

Код:
CMD:refuel(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new engine,lights,alarm,doors,bonnet,boot,objective;
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_ON) return SendClientMessageEx(playerid, COLOR_RED, "You need to shut off the engine before filling up (/car engine or press 2).");
		if(!IsAtFuelStation(playerid)) return SendClientMessageEx(playerid, COLOR_RED, "You're not at a fuel station.");
		if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_RED,"This vehicle doesn't need fuel.");
		if(VehicleFuel[vehicleid] >= 100.0) return SendClientMessageEx(playerid, COLOR_RED, "This vehicle's tank is already full.");
		if(RefuelingVehicle[playerid] == 1) return SendClientMessageEx(playerid, COLOR_RED, "You are refilling your vehicle's tank.");
		SendClientMessageEx(playerid, COLOR_WHITE, "Refueling your vehicle's tank, please wait.");
		RefuelingVehicle[playerid] = 1;
		RefuelingVehicleTimer[playerid] = SetTimerEx("ReFill", 1000, true, "i", playerid);
	}
	return 1;
}
Reply
#2

RefuelingVehicleTimer[playerid] = SetTimerEx("ReFill", 1000, 0, "i", playerid);
Reply
#3

It's not refueling. O.o
Reply
#4

Send the refuel Function
Reply
#5

Код:
CMD:refuel(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		new engine,lights,alarm,doors,bonnet,boot,objective;
		GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
		if(engine == VEHICLE_PARAMS_ON) return SendClientMessageEx(playerid, COLOR_RED, "You need to shut off the engine before filling up (/car engine or press 2).");
		if(!IsAtFuelStation(playerid)) return SendClientMessageEx(playerid, COLOR_RED, "You're not at a fuel station.");
		if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510) return SendClientMessageEx(playerid,COLOR_RED,"This vehicle doesn't need fuel.");
		if(VehicleFuel[vehicleid] >= 100.0) return SendClientMessageEx(playerid, COLOR_RED, "This vehicle's tank is already full.");
		if(RefuelingVehicle[playerid] == 1) return SendClientMessageEx(playerid, COLOR_RED, "You are refilling your vehicle's tank.");
		SendClientMessageEx(playerid, COLOR_WHITE, "Refueling your vehicle's tank, please wait.");
		RefuelingVehicle[playerid] = 1;
		RefuelingVehicleTimer[playerid] = SetTimerEx("ReFill", 1000, 0, "i", playerid);
	}
	return 1;
}
Reply
#6

lol...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)