SendDeathMessage - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SendDeathMessage (
/showthread.php?tid=603403)
SendDeathMessage -
iulicxd - 22.03.2016
OnPlayerDeath:
Код:
SendDeathMessage(killerid, playerid, reason);
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(damagedid != INVALID_PLAYER_ID)
{
if(weaponid == 8) SetPlayerHealth(damagedid, 0);
}
return 1;
}
If i kill a player with katana,reason do not display as i killed player with katana!
but displayed that player death with suicide..
Re: SendDeathMessage -
XtremeRz - 22.03.2016
I think you should put "SendDeathMessage(killerid, playerid, reason);"
Down there in the code, under "if(weaponid ==

SetPlayerHealth(damagedid, 0);"
Since that's not a normal death, this is a "SCRIPTED" death.
Re: SendDeathMessage -
YouServ - 23.03.2016
Yeah normal.
You kill the player with function "SetPlayerHealth" to for the script it's a suicide.
OnPlayerDeath is called with INVALID_PLAYER_ID to killerid and SendDeathMessage displayed a suicide.
For fix that, you need this script :
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
if(damagedid != INVALID_PLAYER_ID)
{
if(weaponid == 8)
{
SetPlayerHealth(damagedid, 0);
SendDeathMessage(playerid, damagedid, 8);
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid)) SendDeathMessage(killerid, playerid, reason);
return 1;
}