27.02.2018, 13:18
Quote:
Ahoj, pouћij public "OnPlayerTakeDamage" vice zde: https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage
Jednoduљe zkontroluj jestli je afk a pak mu nastav zpět ћivoty, kterй mб mнt. Hi, try using public "OnPlayerTakeDamage" more info: https://sampwiki.blast.hk/wiki/OnPlayerTakeDamage Just check if is player afk and then set back his health bar. |
EN: I have wrote following code, but it does not work anyway.
PHP Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(weaponid == 0 && AFK[playerid] == true)
{
new Float:iarmour;
GetPlayerArmour(playerid, iarmour);
if(iarmour > 0)
{
SetPlayerArmour(playerid, amount);
}
else
{
SetPlayerHealth(playerid, amount);
}
}
}
return 1;
}