Textdraw help
#1

I am completely clueless about textdraws, so this is my question:

(OnPlayerDeath)
Textdraw appears for 3 seconds (on the killer's screen after he kills another player) that says +# (# being a number) which that "#" is a value stored in a variable from earlier scripts.. that variable is TextPoints[killerid]

I'm very bad at explaining, so if anything is unclear, I'll try my best to clarify.
Reply
#2

1. For making the textdraw display for 3 seconds and then go away use timers.
2.Dynamically update the string of the textdraw using TextDrawSetString
3.In OnPlayerDeath increase the TextPoints of the killerid by one, and show the textdraw.

Hope you understood me =D
Reply
#3

I know WHAT to do, I just don't know HOW to do it..
Reply
#4

Код:
new Text: Textdraw[MAX_PLAYERS];

public RemoveTextdraw (id) {
    TextDrawDestroy (Textdraw[id]);
    return 1;
}

forward RemoveTextdraw ();

public OnPlayerDeath (playerid, killerid, reason) {
    if (killerid != INVALID_PLAYER_ID) {
        new string[100];
        format (string, sizeof string, "+%i", TextPoints[killerid]);
        Textdraw [killerid] = TextDrawCreate (0.0, 0.0, string);
        TextDrawShowForPlayer (killerid, Textdraw [killerid]);
        SetTimerEx("RemoveTextdraw", 3000, false, "i", killerid);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)