Textdraw Command
#1

Hello all i want to make recent command use textdraw for example :

when player use /smoke

textdraw on screen show Player Name used /smoke in textdraw

how to make it? please help

sorry for my bad english
Reply
#2

What player must see the textdraw? the player who used /smoke or all the players?
Reply
#3

all player see it.. how to make it??

can u help me
Reply
#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
#5

thank you i try it now
Reply
#6

nice but.. i want to make when another player used it show like chat

example

Player 1 has used /smoke
Player 2 has used /weed

like this i show example

http://oi62.tinypic.com/oft2ir.jpg

please help me
Reply
#7

Edit this to your preference
pawn Код:
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]);
And change the command to
pawn Код:
CMD:smoke(playerid, params[])
{
    foreach(new i : Player)
    {
        new string[128], sName[24];
        GetPlayerName(playerid, sName, sizeof(sName));
        format(string, sizeof(string), "~r~[DM] ~w~%s(%d) has joined /smoke", sName, playerid);
        ShowDescriptionText(i, string);
    }
    return 1;
}
I see you like xSF very much.
Reply
#8

i dont know to edit i newbie.
Reply
#9

i want to make when other player use command textdraw show bottom after else used..

example

i use /smoke
when other player used /smoke it show

player 1 used /smoke
player 2 used /smoke

and when 4 textdraw show it loop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)