Create3DTextLabel help
#1

Hello.
I created a command /createlable which created a 3DTextLable at the players position. The command works but it only shows the first letter. For example I type /createlable Hi All, it would just show "h". Here is the code:

pawn Code:
CMD:createlable(playerid,params[])
{
    new Float:x,Float:y,Float:z,texttoput,str[128];
    if(sscanf(params,"s",texttoput)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /createlable <Lable Text>");
    GetPlayerPos(playerid,x,y,z);
    format(str,sizeof(str),"%s",texttoput);
    Create3DTextLabel(str,COLOR_WHITE,x,y,z,40,0,0);
    return 1;
}
Reply
#2

pawn Code:
CMD:createlabel(playerid, params[])
{
    new
        str[128],
        Float:Pos[3]
    ;

    if (sscanf(params, "s[128]", str))
        return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createlabel <Label Text>");

    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    Create3DTextLabel(str, COLOR_WHITE, Pos[0], Pos[1], Pos[2], 40.0, 0, 0);
    return 1;
}
Should work, regards.
Reply
#3

For only admins to use it:

pawn Code:
CMD:createlabel(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 1338) //change "1338" to the selected admin level
    {
        new
            str[128],
            Float:Pos[3]
        ;

        if (sscanf(params, "s[128]", str))
            return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createlabel <Label Text>");

        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        Create3DTextLabel(str, COLOR_WHITE, Pos[0], Pos[1], Pos[2], 40.0, 0, 0);
        return 1;
    }
    else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
    return 1;
}
Reply
#4

It workds thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)