21.10.2017, 17:05
I'm making /taser command, but i can't figure out how to prevent taking damage for the shooted player without using OnPlayerUpdate callback.
Any suggestions?
Any suggestions?
Yeah i know, but which method i should use?
For example, i tried to give back the player's damage under OnPlayerTakeDamage, but it doesn't work. |
new Float:health; GetPlayerHealth(damagedid,health); SetPlayerHealth(damagedid,health);
SetPlayerHealth(damagedid,health);
SetPlayerHealth(damagedid,health + amount);
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype==BULLET_HIT_TYPE_PLAYER && GetPlayerWeapon(playerid)==23){//colt
return 0; //prevents player taking damage
}
return 1;
}