05.04.2018, 10:38
@Dirda here you go mate
Ann me if is something wrong.
Код HTML:
// Variable and a Timer that activate the injure system. new Injured[MAX_PLAYERS], Timer:InjureTime[MAX_PLAYERS]; // You need to add this variables and timers that i added under OnPlayerTakeDamage / OnPlayerDeath / OnPlayerDisconnect // You need to add this variables and timers that i added under OnPlayerTakeDamage / OnPlayerDeath / OnPlayerDisconnect // You need to add this variables and timers that i added under OnPlayerTakeDamage / OnPlayerDeath / OnPlayerDisconnect public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) { if(Injured[playerid] == 1) return 1; Injured[playerid] = 1, InjureTime[playerid] = repeat InjuredTime(playerid); return 1; } public OnPlayerDeath(playerid, killerid, reason) { Injured[playerid] = 0; stop InjureTime(playerid); return 1; } public OnPlayerDisconnect(playerid, reason) { Injured[playerid] = 0; stop InjureTime(playerid); return 1; } // This timer you can add everywhere in your script, mostly go at the bottom. timer InjuredTime[5000](playerid) { new Float:HP; GetPlayerHealth(playerid, HP); if(Injured[playerid] == 1) SetPlayerHealth(playerid, HP-1); return 1; }