Random player death message
#1

pawn Код:
//RANDOM DEATH MESSAGES
new RandomDeath[][] =
{
    "was killed by",
    "was fragged by",
    "was ended by",
    "was pulverized by"

};

new RandomSuicide[][] =
{
    "committed suicide",
    "took thier own life",
    "messed up"
};
For the sake of putting my code on here, i changed all those messages from what they really are oin my server xD. Anyway, this is in OnPlayerDeath()
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

        //OTHER CODE......

    if(!killerid){
   
        GetPlayerName(playerid, kname, MAX_PLAYER_NAME);
        GetPlayerName(killerid, dname, MAX_PLAYER_NAME);
        format(allmessage, sizeof(allmessage), "{00FF00}%s{FFFFFF} %s {00FF00}%s.", kname, RandomDeath[random(sizeof(RandomDeath))], dname);
        SendClientMessageToAll(-1, allmessage);
       
    } else {
        GetPlayerName(playerid, dname, MAX_PLAYER_NAME);
        format(allmessage, sizeof(allmessage), "{00FF00}%s{FFFFFF} %s", dname, RandomSuicide[random(sizeof(RandomSuicide))]);
        SendClientMessageToAll(-1, allmessage);
    }

    //OTHER CODE....

}
When a user dies, it just displays a random message from either one, for instance, if I commit suicide, sometimes it will say "USERNAME got killed by" and if I get killed by someone else, sometimes the message will be something like "USERNAME committed suicide"

Anyone see why?
Reply


Messages In This Thread
Random player death message - by Nathan_Taylor - 15.03.2013, 18:29
Re: Random player death message - by Jstylezzz - 15.03.2013, 18:36
Re: Random player death message - by Vince - 15.03.2013, 18:38
Re: Random player death message - by Nathan_Taylor - 15.03.2013, 18:41

Forum Jump:


Users browsing this thread: 1 Guest(s)