SA-MP Forums Archive
Delete player 3d text label????? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Delete player 3d text label????? (/showthread.php?tid=427411)



Delete player 3d text label????? - NicholasA - 01.04.2013

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;
}



Re: Delete player 3d text label????? - SuperViper - 01.04.2013

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.


Re: Delete player 3d text label????? - brawrr - 01.04.2013

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;