SA-MP Forums Archive
Onplayerdeath Reason - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Onplayerdeath Reason (/showthread.php?tid=75370)



Onplayerdeath Reason - Kyle - 01.05.2009

Hello currently im coding a protect the president gamemode.

How do i do the reasons like

I need a message to say weather he was killed in a accident or weather he was killed by team_terrorists how do i do it thanks


Re: Onplayerdeath Reason - [HiC]TheKiller - 01.05.2009

If you are using gTeam or variables:

pawn Код:
if(gTeam[killerid] == gTeam[playerid])
{
  //This is a team kill
}
else
{
  //This is if a person on another team kills them
}
It's almost the same using GetPlayerTeam.


Re: Onplayerdeath Reason - MenaceX^ - 01.05.2009

pawn Код:
new string[128];
GetWeaponName(reason,string,sizeof(string));
format(string,sizeof(string),"%s killed %s by using his %s.",name(playerid),name(killerid),string);
SendClientMessageToAll(color,string);



Re: Onplayerdeath Reason - SpiderPork - 01.05.2009

pawn Код:
new string[128],
  name[MAX_PLAYER_NAME],
  killername[MAX_PLAYER_NAME];

GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(killerid, killername, sizeof(killername));
GetWeaponName(reason, string, sizeof(string));
format(string, sizeof(string), "* %s killed %s by using his/her %s.", killername[playerid], name[killerid], string);
SendClientMessageToAll(RED, string);



Re: Onplayerdeath Reason - Kyle - 01.05.2009

This dont help me ?



How do i know if the president was killed in a accident eg car explosion

or weather the president was killed purposly by terrorists


Re: Onplayerdeath Reason - Kyle - 01.05.2009

Bump


Re: Onplayerdeath Reason - Garf. - 12.05.2009

if killerid == INVALID_PLAYER_ID he was killed not by a player.