toribio

toribio

May 4th, 2010
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.56 KB | None | 0 0
  1. //topo
  2. forward Carro();
  3.  
  4. //OnGameModeInit
  5. SetTimer("Carro", 1000, 1);
  6.  
  7. public Carro()
  8. {
  9.     static Float:gheal[MAX_VEHICLES];
  10.     for(new v = 0; i < MAX_VEHICLES; ++v) if(GetVehicleModel(v))
  11.     {
  12.         new Float:vheal;
  13.         GetVehicleHealth(v, vheal);
  14.         if(vheal < gheal[v])
  15.         {
  16.             new p;
  17.             for(p = 0; p < MAX_PLAYERS; ++p)
  18.             {
  19.                 if(IsPlayerInVehicle(p, v))
  20.                     break;
  21.             }
  22.             if(IsPlayerConnected(p))
  23.             {
  24.                 new Float:pheal;
  25.                 GetPlayerHealth(p, pheal);
  26.                 SetPlayerHealth(playerid, pheal - ((gheal - vheal) / 15));
  27.             }
  28.             gheal[v] = vheal;
  29.         }
  30.     }
  31. }
Add Comment
Please, Sign In to add comment