SA-MP Forums Archive
OnPlayerDeathTextDraw - 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: OnPlayerDeathTextDraw (/showthread.php?tid=74770)



OnPlayerDeathTextDraw - HydraX - 25.04.2009

i need help with OnPlayerDeathTextDraw

how do i do it?

i looked but seems that i cant find it

help plz


Re: OnPlayerDeathTextDraw - Mike-Chip - 25.04.2009

You mean when a player died it creates a textdraw ?



Re: OnPlayerDeathTextDraw - HydraX - 26.04.2009

no

o made a textdraw on the bottom but i want it to see when the player dies

it show on the bottom who killed the person and etc


Re: OnPlayerDeathTextDraw - HydraX - 26.04.2009

*Bump


Re: OnPlayerDeathTextDraw - Mike-Chip - 26.04.2009

A textdraw like... "Killer" has killed "Player" ?

The killer and player will see, right ?


Re: OnPlayerDeathTextDraw - HydraX - 26.04.2009

yea


Re: OnPlayerDeathTextDraw - mascii - 26.04.2009

Justmake the text draw, then on player death show it, then on player spawn hide it. If u want it on longer than that then use a timer


Re: OnPlayerDeathTextDraw - Mike-Chip - 26.04.2009

Here some simple code... you can change the positions, colors, etc.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Text:DeathText;
    new KName[128], DName[128], string[64];
    GetPlayerName(killerid, KName, sizeof(KName));
    GetPlayerName(playerid, DName, sizeof(DName));

    if(killerid != INVALID_PLAYER_ID)
    {
        DeathText = TextDrawCreate(380.000000,400.000000,"-");
        TextDrawLetterSize(DeathText, 0.399999, 2.099999);
        TextDrawFont(DeathText, 2);
        TextDrawSetOutline(DeathText, 2);
        TextDrawSetProportional(DeathText, 3);
        format(string, sizeof(string), "%s has killed %s", KName, DName );
        TextDrawSetString(DeathText, string );
        TimeTextForPlayer(playerid, Text:DeathText, 5000);
        TimeTextForPlayer(killerid, Text:DeathText, 5000);
    }
}
We don't want errors right ? Just make sure this code is in your script:
pawn Код:
forward TimeTextForPlayer(playerid, Text:text, time);
public TimeTextForPlayer(playerid, Text:text, time)
{
    TextDrawShowForPlayer(playerid,text);
    SetTimerEx("DestroyTextTimer",time,0,"i",_:text); // _: from Simon
}

forward DestroyTextTimer(Text:text);
public DestroyTextTimer(Text:text)
{
    TextDrawDestroy(text);
}