28.10.2012, 18:45
Not like this:
Try this:
That should do it!
Код:
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; }