Random TextDraw in "OnPlayerDeath"?
#4

You have to write textdraw code yourself (and if your next post/thread will be "pls give me textdraw code", I'll find you, and I'll kill you. Search for editor, or for tutorial using this forums search function/******).

First of all, create an array containing your messages (outside callbacks/functions, best if somewhere near top of your script)

pawn Код:
new const DeathMessages[3][32] = {
    "Damn man, you suck!",
    "Get the hell up",
    "HA-HA, HA-HA"
};
The "const" means you won't change those messages programmatically later, 3 is the number of your messages, 32 is max length of your single message. You could use packed strings to make stuff take less memory, but I don't think I'm able to explain it to you.

Now, you just have to use random(number of messages), and you are set.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
    SendClientMessage(playerid, -1, DeathMessages[random(3)]);
    return 1;
}
Change SendClientMessage code to your textdraw code, and done!

@up: ಠ_ಠ
Reply


Messages In This Thread
Random TextDraw in "OnPlayerDeath"? - by KurtAngle - 29.08.2013, 07:54
Re: Random TextDraw in "OnPlayerDeath"? - by KurtAngle - 29.08.2013, 10:08
Re: Random TextDraw in "OnPlayerDeath"? - by Konstantinos - 29.08.2013, 10:18
Re: Random TextDraw in "OnPlayerDeath"? - by Misiur - 29.08.2013, 10:21
Re: Random TextDraw in "OnPlayerDeath"? - by Aliassassin123456 - 29.08.2013, 10:28
Re: Random TextDraw in "OnPlayerDeath"? - by KurtAngle - 29.08.2013, 10:51

Forum Jump:


Users browsing this thread: 1 Guest(s)