Will this W0rK ?
#6

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
I think you don't need main() at your filterscript.
No, you don't need it.

You created per-player textdraw but the tag was for glabal TDs. Anyways, I fixed few things, it should work.

pawn Код:
#include <a_samp>

#undef MAX_PLAYERS
#define MAX_PLAYERS 50 // Define it with the slots you want (no need 500.. waste)

new
    PlayerText: KillTextDraw[ MAX_PLAYERS ]
;

public OnPlayerConnect(playerid)
{
    KillTextDraw[playerid] = CreatePlayerTextDraw(playerid, 188.0, 89.0, "You got killed by N/A");
    PlayerTextDrawLetterSize(playerid, KillTextDraw[playerid], 0.449999, 1.600000);
    PlayerTextDrawAlignment(playerid, KillTextDraw[playerid], 1);
    PlayerTextDrawColor(playerid, KillTextDraw[playerid], 16777215);
    PlayerTextDrawSetShadow(playerid, KillTextDraw[playerid], 0);
    PlayerTextDrawSetOutline(playerid, KillTextDraw[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, KillTextDraw[playerid], 51);
    PlayerTextDrawFont(playerid, KillTextDraw[playerid], 1);
    PlayerTextDrawSetProportional(playerid, KillTextDraw[playerid], 1);
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new
        ptname[ MAX_PLAYER_NAME ],
        string[ 43 ]
    ;
    GetPlayerName(killerid,ptname,MAX_PLAYER_NAME);
    format(string,sizeof(string),"You got killed by %s",ptname);

    PlayerTextDrawSetString(playerid, KillTextDraw[playerid], string);
    PlayerTextDrawShow(playerid, KillTextDraw[playerid]);
    SetTimerEx("HideKillDraw", 3000, false, "d", playerid);
    return 1;
}

forward HideKillDraw(playerid);
public HideKillDraw(playerid)
{
    PlayerTextDrawHide(playerid, KillTextDraw[playerid]);
}
PS: Per-player's textdraws get destroyed automatically when a player disconnects.
Reply


Messages In This Thread
Will this W0rK ? - by Insulin - 24.08.2013, 11:18
Re: Will this W0rK ? - by Konstantinos - 24.08.2013, 11:27
Re: Will this W0rK ? - by Insulin - 24.08.2013, 13:16
Re: Will this W0rK ? - by RedJohn - 24.08.2013, 13:27
Re: Will this W0rK ? - by ProjectMan - 24.08.2013, 13:34
Re: Will this W0rK ? - by Konstantinos - 24.08.2013, 13:34
Re: Will this W0rK ? - by Insulin - 24.08.2013, 13:49
Re: Will this W0rK ? - by Konstantinos - 24.08.2013, 13:52

Forum Jump:


Users browsing this thread: 3 Guest(s)