i need help in OnPlayerDeath
#2

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


Messages In This Thread
i need help in OnPlayerDeath - by dr.lozer - 28.10.2012, 18:20
Re: i need help in OnPlayerDeath - by adithegman - 28.10.2012, 18:45
Re: i need help in OnPlayerDeath - by Lordzy - 29.10.2012, 02:40
Re: i need help in OnPlayerDeath - by SuperViper - 29.10.2012, 02:57
Re: i need help in OnPlayerDeath - by Stu1 - 29.10.2012, 03:28
Re: i need help in OnPlayerDeath - by dr.lozer - 29.10.2012, 08:42
Re: i need help in OnPlayerDeath - by gtakillerIV - 29.10.2012, 10:05

Forum Jump:


Users browsing this thread: 1 Guest(s)