Vehicle Health
#10


pawn Код:
new Float:oldv[MAX_PLAYERS];
new Float:newv[MAX_PLAYERS];
forward health();
forward vhealth();


public health()
{
  for(new i=0;i<MAX_PLAYERS;i++)
  {
    if(PlayerDerby[i] == 1)
    {
      if(IsPlayerInAnyVehicle(i))
      {
        new Float:carhp, Float:FinalHP;
        new VID = GetPlayerVehicleID(i);
        GetVehicleHealth(VID, carhp);
        FinalHP = carhp/10;
        oldv[i] = floatround(FinalHP, floatround_round);
        SetTimerEx("vhealth",20000,0,i,playerid);
      }
    }
  }

}

public vhealth()
{
  for(new i=0;i<MAX_PLAYERS;i++)
  {
    if(PlayerDerby[i] == 1)
    {
      if(IsPlayerInAnyVehicle(i))
      {
        new Float:carhp, Float:FinalHP;
        new VID = GetPlayerVehicleID(i);
        GetVehicleHealth(VID, carhp);
        FinalHP = carhp/10;
        newv[i] = floatround(FinalHP, floatround_round);
        SetTimerEx("health",1000,0,i,playerid);
        if(oldv[i] == newv[i]) RemovePlayerFromVehicle(i);
      }
    }
  }
}
sorry if i have done anything wrong that wat u said, i just started learning pawno
Reply


Messages In This Thread
Vehicle Health - by cloud9 - 14.06.2009, 05:31
Re: Vehicle Health - by lavamike - 14.06.2009, 05:51
Re: Vehicle Health - by cloud9 - 14.06.2009, 07:15
Re: Vehicle Health - by dice7 - 14.06.2009, 07:19
Re: Vehicle Health - by cloud9 - 14.06.2009, 07:28
Re: Vehicle Health - by dice7 - 14.06.2009, 09:04
Re: Vehicle Health - by Grim_ - 14.06.2009, 09:07
Re: Vehicle Health - by cloud9 - 14.06.2009, 09:22
Re: Vehicle Health - by Grim_ - 14.06.2009, 09:25
Re: Vehicle Health - by cloud9 - 14.06.2009, 09:54

Forum Jump:


Users browsing this thread: 1 Guest(s)