Onplayerdeath Reason
#1

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
Reply
#2

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.
Reply
#3

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);
Reply
#4

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);
Reply
#5

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
Reply
#6

Bump
Reply
#7

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


Forum Jump:


Users browsing this thread: 2 Guest(s)