Vehicle Health
#1

I have coded such that when a players Vehicle health is same for a period of 20 seconds he get removed from his vehicles. But it removes players from their vehicle even the health has changed, plz help tia.

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))
    {
      GetVehicleHealth(GetPlayerVehicleID(i),oldv[i]);
            SetTimer("vhealth",20000,0);
       
        }
   
        }
        }

}
public vhealth()
{
        for(new i=0;i<MAX_PLAYERS;i++)
    {
      if(PlayerDerby[i] == 1){
        if(IsPlayerInAnyVehicle(i))
      {
      GetVehicleHealth(GetPlayerVehicleID(i),newv[i]);
            SetTimer("health",1000,0);
            if (oldv[i] == newv[i]) RemovePlayerFromVehicle(i);

       
        }
        }
        }
   
}
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)