SA-MP Forums Archive
Random Death Text? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random Death Text? (/showthread.php?tid=167510)



Random Death Text? - Nathan_Taylor - 12.08.2010

How can I make it so that I can have something like this...
Код:
new RandomDeath[][] =
{
    " was killed.",
    " ate the dirt.",
    " is in a better place.",
    " went to hell."
};
and on player death have it show the username of the player, then a random line from above?
Ex: "Nathan_Taylor was killed." OR "Nathan_Taylor went to hell."


Re: Random Death Text? - JaTochNietDan - 12.08.2010

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    new string[128], pname[24];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string,sizeof(string),"%s %s",pname,RandomDeath[random(sizeof(RandomDeath))]);
    SendClientMessageToAll(COLOR_GREEN,string);
    return 1;
}