SA-MP Forums Archive
Textdraw autodestroy. - 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)
+--- Thread: Textdraw autodestroy. (/showthread.php?tid=539232)



Textdraw autodestroy. - Ryz - 27.09.2014

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!


Re: Textdraw autodestroy. - biker122 - 27.09.2014

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


Re: Textdraw autodestroy. - TLN - 27.09.2014

Use a timer.


Re: Textdraw autodestroy. - Ryz - 27.09.2014

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);



Re: Textdraw autodestroy. - Stinged - 27.09.2014

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.


Re: Textdraw autodestroy. - Ryz - 27.09.2014

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


Re: Textdraw autodestroy. - Pottus - 27.09.2014

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.


Re: Textdraw autodestroy. - Ryz - 27.09.2014

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