Textdraw autodestroy.
#1

I am have made textdraw that shows when player kill some one

this is example[Not mine td]


But i want know that how to setting up that textdraw automatically destroy after 5 sec!
Reply
#2

Show how you've defined the textdraws. (or) how you show it when a player kills someone.
Reply
#3

Use a timer.
Reply
#4

pawn Код:
new Text:Killed;

   
//TEXTDRAW
        Killed = TextDrawCreate(398.242858, 201.833389, "ENEMY KILLED +1 SCORE~n~ +$2500 CASH");
    TextDrawLetterSize(Killed, 0.250409, 1.296666);
    TextDrawAlignment(Killed, 1);
    TextDrawColor(Killed, -1);
    TextDrawSetShadow(Killed, 0);
    TextDrawSetOutline(Killed, 1);
    TextDrawBackgroundColor(Killed, 51);
    TextDrawFont(Killed, 2);
    TextDrawSetProportional(Killed, 1);


public OnPlayerDeath(playerid, killerid, reason)

                new msg[100];
        new ammount = random(1000);
        new amm = random(100);
        TextDrawShowForPlayer(playerid, Killed); //LOOK HERE
        format(msg, sizeof(msg), "Good job killing %s you have earn +1 score and $%d cash!",    PlayerName2(playerid),ammount);
        SendClientMessage(killerid,green,msg);
        GivePlayerMoney(killerid,ammount);
        GivePlayerMoney(playerid,-amm);
        format(msg, sizeof(msg), "You lost %d cash for dying.",amm);
Reply
#5

pawn Код:
SetTimerEx("KillTD_Hide", 5000, false, "i", playerid); // Under TextDrawShowForPlayer

// Outside of all callbacks
forward KillTD_Hide(playerid);
public KillTD_Hide(playerid)
{
    TextDrawHideForPlayer(playerid, Killed);
    return 1;
}
Try that.
Reply
#6

added. but need to test with two players. maybe i will reply after hour...if its fail
Reply
#7

Why in the hell would you keep creating and destroying textdraws that is silly instead create a player textdraw when they connect then use hide and show.
Reply
#8

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Why in the hell would you keep creating and destroying textdraws that is silly instead create a player textdraw when they connect then use hide and show.
please explain
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)