Headtext over the Head
#4

pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
#include <sscanf2>

new Text3D:MyLabel[MAX_PLAYERS];

stock AttachHeadColor(playerid, color, text[])
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    MyLabel[playerid] = Create3DTextLabel(text, color, x, y, z + 1.0, 10.0, 0);
    Attach3DTextLabelToPlayer(MyLabel[playerid], playerid, 0.0, 0.0, 1.0);
    return 1;
}
 
CMD:headtext(playerid, params[])
{
    new color[12], text[128];
    if (sscanf(params, "s[12]s[128]", color, text))
    {
        SendClientMessage(playerid, 0xAFAFAFFF, "USAGE: /headtext [color] [text]");
        return 1;
    }
    if (strcmp(color, "blue", true) == 0) AttachHeadColor(playerid, 0x0000FFFF, text);
    if (strcmp(color, "yellow", true) == 0) AttachHeadColor(playerid, 0xFFFF00FF, text);
    if (strcmp(color, "green", true) == 0) AttachHeadColor(playerid, 0x00FF00FF, text);
    if (strcmp(color, "white", true) == 0) AttachHeadColor(playerid, 0xFFFFFFFF, text);
    if (strcmp(color, "red", true) == 0) AttachHeadColor(playerid, 0xFF0000FF, text);
    if (strcmp(color, "cyan", true) == 0) AttachHeadColor(playerid, 0x33CCFFFF, text);
    SendClientMessage(playerid, 0xFFFF00FF, "Text attached to head (type /removetext to remove it).");
    return 1;
}

CMD:removetext(playerid, params[])
{
    Delete3DTextLabel(MyLabel[playerid]);
    SendClientMessage(playerid, 0xFFFF00FF, "Text removed.");
    return 1;
}
Reply


Messages In This Thread
Headtext over the Head - by Blackazur - 28.09.2012, 21:12
Re: Headtext over the Head - by BlacK_RiDeR - 28.09.2012, 21:14
AW: Headtext over the Head - by Blackazur - 28.09.2012, 21:28
Re: Headtext over the Head - by Emmet_ - 28.09.2012, 21:29
Re: Headtext over the Head - by BlacK_RiDeR - 28.09.2012, 21:32

Forum Jump:


Users browsing this thread: 1 Guest(s)