[Tutorial] How to prevent damage
#5

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
No, there's no way to do that.
You can only reverse the damage by putting his health back when he's hit, but apart from OnPlayerWeaponShot the callbacks are only called afterwards as mentioned.
Basically this:
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
        new Float:Health;
	
	GetPlayerHealth(damagedid, Health);
	
	if(playerid != INVALID_PLAYER_ID)
	{
		SetPlayerHealth(damagedid, Health);
	}
    
    return 1;
}
Reply


Messages In This Thread
How to prevent damage - by Manyula - 04.05.2016, 10:47
Re: How to prevent damage - by Wolfe - 04.05.2016, 11:54
Re: How to prevent damage - by CalvinC - 04.05.2016, 12:14
Re: How to prevent damage - by Wolfe - 04.05.2016, 12:17
Re: How to prevent damage - by F1N4L - 04.05.2016, 12:25
Re: How to prevent damage - by CalvinC - 04.05.2016, 12:33
Re: How to prevent damage - by F1N4L - 04.05.2016, 12:45
Re: How to prevent damage - by SyS - 04.05.2016, 14:45
Re: How to prevent damage - by Manyula - 04.05.2016, 16:19

Forum Jump:


Users browsing this thread: 2 Guest(s)