Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //topo
- forward Carro();
- //OnGameModeInit
- SetTimer("Carro", 1000, 1);
- public Carro()
- {
- static Float:gheal[MAX_VEHICLES];
- for(new v = 0; i < MAX_VEHICLES; ++v) if(GetVehicleModel(v))
- {
- new Float:vheal;
- GetVehicleHealth(v, vheal);
- if(vheal < gheal[v])
- {
- new p;
- for(p = 0; p < MAX_PLAYERS; ++p)
- {
- if(IsPlayerInVehicle(p, v))
- break;
- }
- if(IsPlayerConnected(p))
- {
- new Float:pheal;
- GetPlayerHealth(p, pheal);
- SetPlayerHealth(playerid, pheal - ((gheal - vheal) / 15));
- }
- gheal[v] = vheal;
- }
- }
- }
Add Comment
Please, Sign In to add comment