Delete player 3d text label?????
#1

So I want to remove a text label but how do I know the label id?
code:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/afk", cmdtext, true, 10) == 0)
    {
        if(isafk)
        {
    		DeletePlayer3DTextLabel(playerid, WHAT ID DO I PUT HERE);
        }
        else
        {
    		new Text3D:label = Create3DTextLabel("Currently AFK.", 0xFFC70855, 30.0, 40.0, 50.0, 40.0, 0);
    		Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
        }

        return 1;
    }

    return 0;
}
Reply
#2

You need to create the variable label outside of OnPlayerCommandText and then assign it inside of it. Then you put label in the delete line.
Reply
#3

PHP код:
new Text3D:label
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/afk"cmdtexttrue10) == 0)
    {
        if(
isafk)
        {
            
DeletePlayer3DTextLabel(playeridlabel);
        }
        else
        {
            
label Create3DTextLabel("Currently AFK."0xFFC7085530.040.050.040.00);
            
Attach3DTextLabelToPlayer(labelplayerid0.00.00.7);
        }
        return 
1;
    }
    return 
0;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)