public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(deagledm[playerid] == 1)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 9)
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_FIREBRICK, "** A bullet came straight into your head, you was killed by a headshot. **");
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 3)
{
SetPlayerHealth(playerid, 149);
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 4)
{
SetPlayerHealth(playerid, 149);
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 5)
{
SetPlayerHealth(playerid, 149);
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 6)
{
SetPlayerHealth(playerid, 149);
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 7)
{
SetPlayerHealth(playerid, 149);
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 24 && bodypart == 8)
{
SetPlayerHealth(playerid, 149);
}
}
else return 0;
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
if(issuerid == INVALID_PLAYER_ID) return 1;
if(deagledm[playerid])
{
if(weaponid == 24)
{
switch(bodypart)
{
case 9:
{
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, COLOR_FIREBRICK, "** A bullet went straight into your head, you were killed by a headshot. **");
}
case 3 .. 8: SetPlayerHealth(playerid, 149.0);
}
}
}
return 1;
}
Originally Posted by SA-MP Wiki
Return Values:
1 - Allows this callback to be called in other scripts. 0 - Callback will not be called in other scripts. It is always called first in gamemodes so returning 0 there blocks filterscripts from seeing it |