Car engine help
#4

Your code only checks the health if someone enters the car not whilst he drivers, So here
Код:
forward CarWrecked();
Under Ongamemodeint     SetTimer("CarWrecked", 500, true);
anywhere
public CarWrecked()
{
	for(new i; i < MAX_PLAYERS; i++)
	{
	    new Float:VehHealth;
	    new PlayerVehicle;
	    PlayerVehicle = GetPlayerVehicleID(i);
	    GetVehicleHealth(PlayerVehicle, VehHealth);
	    if(IsPlayerInAnyVehicle(i))
	    {
	    if(VehHealth < 300)
	    {
	        RemovePlayerFromVehicle(i);
	        SetVehicleHealth(PlayerVehicle, 299);
	        GameTextForPlayer(i, "~r~ Wrecked", 2000, 4);
			}
		}
	}
	return 1;
}
Reply


Messages In This Thread
Car engine help - by Wesley221 - 17.05.2011, 15:56
Re: Car engine help - by cessil - 17.05.2011, 15:58
Re: Car engine help - by Wesley221 - 17.05.2011, 16:34
Re: Car engine help - by Swiftz - 17.05.2011, 16:41
Re: Car engine help - by cessil - 17.05.2011, 16:58
Re: Car engine help - by Wesley221 - 17.05.2011, 17:03
Re: Car engine help - by Swiftz - 17.05.2011, 17:11
Re: Car engine help - by Wesley221 - 17.05.2011, 17:18
Re: Car engine help - by cessil - 18.05.2011, 01:04
Re: Car engine help - by Wesley221 - 18.05.2011, 06:31

Forum Jump:


Users browsing this thread: 2 Guest(s)