public OnPlayerDeath(playerid, killerid, reason)
{
new Message[128];
if(killerid == playerid) {
format(Message,128,"{FFAF00}%s {B8FF02}has {F81414}died",PlayerName(playerid),reason);
}else {
format(Message,128,"{FFAF00}%s {B8FF02}has {F81414}killed {FFAF00}%s",PlayerName(killerid),PlayerName(playerid));
}
SendClientMessageToAll(COLOR_RED,Message);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Message[128];
if(killerid == playerid) {
format(Message,128,"{FFAF00}%s {B8FF02}has {F81414}died",PlayerName(playerid),reason);
}else {
format(Message,128,"{FFAF00}%s {B8FF02}has {F81414}killed {FFAF00}%s",PlayerName(killerid),PlayerName(playerid));
}
SendClientMessageToAll(COLOR_RED,Message); // this is wrong because we have 2 cases and just 1 function
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Message[128];
if(killerid == playerid) {
format(Message,128,"{FFAF00}%s {B8FF02}has {F81414}died",PlayerName(playerid),reason);
SendClientMessageToAll(COLOR_RED,Message); // so because we had 2 cases we maked 2 SendClientMessageToAll, one here...
}else {
format(Message,128,"{FFAF00}%s {B8FF02}has {F81414}killed {FFAF00}%s",PlayerName(killerid),PlayerName(playerid));
SendClientMessageToAll(COLOR_RED,Message); // and 1 here, now we have 2 cases and 2 functions, do you understand me?
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Message[128];
new Lname[MAX_PLAYER_NAME], Kname[MAX_PLAYERS];
GetPlayerName(playerid, Lname, sizeof(Lname));
GetPlayerName(killerid, Kname, sizeof(Kname));
if(killerid == playerid)
{
format(Message,sizeof(Message),"{FFAF00}%s {B8FF02}has {F81414}died %s",Lname, reason);
SendClientMessageToAll(0xFF0000FF,Message);
}
else
{
format(Message,sizeof(Message),"{FFAF00}%s {B8FF02}has {F81414}killed {FFAF00}%s", Kname, Lname);
SendClientMessageToAll(0xFF0000FF,Message);
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new Message[128];
if(killerid == INVALID_PLAYER_ID)
{
format(Message, 128, "{FFAF00}%s {B8FF02}has {F81414}died", PlayerName(playerid), reason);
}
else
{
format(Message, 128, "{FFAF00}%s {B8FF02}has {F81414}killed {FFAF00}%s", PlayerName(killerid), PlayerName(playerid));
}
SendClientMessageToAll(COLOR_RED, Message);
return 1;
}
|
pawn Код:
|
if(killerid == playerid)
if(killerid == INVALID_PLAYER_ID)
if(killerid != INVALID_PLAYER_ID)//This means that if killerid doesn't equal to an invalid player ID.
{
//Rest of the code here.
}