Help with timer pleaseleplpeal
#1

I made a fuel system
and how do i make a timer every 50 seconds fuel will down with 1
Gas[vehicle] -= 1;
Reply
#2

Use SetTimerEx
Reply
#3

can u help me with that?
Reply
#4

Can you show me the proper codes?
Reply
#5

Код:
public CheckGas()
{
	new string[256];
	for(new i=0;i<PLAYERS;i++)
	{
    	if(IsPlayerConnected(i))
       	{
       	    if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
       	    {
	       		new vehicle = GetPlayerVehicleID(i);
	        	if(Gas[vehicle] >= 1)
		   		{
		   		    if(Gas[vehicle] > 100)
						Gas[vehicle] = 100;
		   		    if(Gas[vehicle] <= 10)
				    {
			   			PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
			   			if(gGas[i] == 0) {
			   				GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Fuel is low",5000,3);
						}
				    }
		   		    if(gGas[i] == 1) {
		   		    if(IsAPlane(vehicle) || IsABoat(vehicle) || IsAHarvest(vehicle) || IsADrugHarvest(vehicle) || IsASweeper(vehicle) || GetVehicleModel(vehicle) == 481)
		   		    {
		      			format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Fuel:~w~ N/A");
					}
					else
					{
                        format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Fuel:~w~ %d%",Gas[vehicle]);
					}
		      		GameTextForPlayer(i,string,20500,3); }
					if(IsAPlane(vehicle) || IsABoat(vehicle) || IsAHarvest(vehicle) || IsADrugHarvest(vehicle) || IsASweeper(vehicle) || GetVehicleModel(vehicle) == 481 || engineOn[vehicle] == 0) { Gas[vehicle]++; }
	              	Gas[vehicle]--;
		   		}
	   			else
	           	{
	              	NoFuel[i] = 1;
					new engine,lights,alarm,doors,bonnet,boot,objective;
					GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
					SetVehicleParamsEx(vehicle,0,0,alarm,doors,bonnet,boot,objective);
	              	TogglePlayerControllable(i, 0);
		        	GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~No fuel in Vehicle",1500,3);
				}
			}
    	}
	}
	return 1;
}
and i want to make it textdraw not gametext it sucks like this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)