Textdraw Command
#4

pawn Код:
#include <a_samp>
#include <foreach> // We need this for looping

new Text:DescriptionText[MAX_PLAYERS];
new DescriptionTimer[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    DescriptionText[playerid] = TextDrawCreate(320.0, 380.0, " ");
    TextDrawAlignment(DescriptionText[playerid], 2);
    TextDrawFont(DescriptionText[playerid], 1);
    TextDrawLetterSize(DescriptionText[playerid], 0.320000, 1.700000);
    TextDrawSetOutline(DescriptionText[playerid], 1);
    TextDrawHideForPlayer(playerid, DescriptionText[playerid]);
    return 1;
}

forward HideDescriptionText(playerid);
public HideDescriptionText(playerid)
{
    TextDrawHideForPlayer(playerid, DescriptionText[playerid]);
    return 1;
}

CMD:smoke(playerid, params[])
{
    foreach(new i : Player)
    {
        new string[128], sName[24];
        GetPlayerName(playerid, sName, sizeof(sName));
        format(string, sizeof(string), "~r~%s ~w~has used the command ~b~/smoke", sName);
        ShowDescriptionText(i, string);
    }
    return 1;
}

stock ShowDescriptionText(playerid, string[])
{
    KillTimer(DescriptionTimer[playerid]);
    TextDrawSetString(DescriptionText[playerid], string);
    TextDrawShowForPlayer(playerid, DescriptionText[playerid]);
    DescriptionTimer[playerid] = SetTimerEx("HideDescriptionText", 5000, 0, "i", playerid);
    return 1;
}
You can set it to a different position if you want. I just used this tutorial to make the textdraws.
Reply


Messages In This Thread
Textdraw Command - by mohdapiz - 26.07.2014, 01:30
Re: Textdraw Command - by Blademaster680 - 26.07.2014, 01:47
Re: Textdraw Command - by mohdapiz - 26.07.2014, 01:51
Re: Textdraw Command - by Affan - 26.07.2014, 04:11
Re: Textdraw Command - by mohdapiz - 26.07.2014, 04:21
Re: Textdraw Command - by mohdapiz - 26.07.2014, 04:43
Re: Textdraw Command - by Affan - 26.07.2014, 04:46
Re: Textdraw Command - by mohdapiz - 26.07.2014, 05:27
Re: Textdraw Command - by mohdapiz - 26.07.2014, 05:49

Forum Jump:


Users browsing this thread: 1 Guest(s)