SA-MP Forums Archive
Attached Label cant delete - 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: Attached Label cant delete (/showthread.php?tid=338828)



Attached Label cant delete - Admigo - 01.05.2012

Heey all,

I made a afk and back command.
But when i do /back the 3dtextlabel is still above my head.
Код:
if (strcmp("/back", cmdtext, true, 10) == 0)
	{
		TogglePlayerControllable(playerid,1);
		Delete3DTextLabel(Paused[playerid]);
		SendClientMessage(playerid,COLOR_PINK,"[Pause] You are not Paused Anymore !");
		return 1;
	}
	if (strcmp("/afk", cmdtext, true, 10) == 0)
	{
		
		Paused[playerid] = Create3DTextLabel("Paused",-1,30.0,40.0,50.0,40.0,0);
 		Attach3DTextLabelToPlayer(Paused[playerid], playerid, 0.0, 0.0, 0.7);
 		TogglePlayerControllable(playerid,0);
 		SendClientMessage(playerid,COLOR_PINK,"[Pause] You are Paused!");
		return 1;
	}
How can i fix this?

Thanks Admigo


Re: Attached Label cant delete - Faisal_khan - 01.05.2012

This under OnGameModeInit:
pawn Код:
Paused[playerid] = Create3DTextLabel("Paused",-1,30.0,40.0,50.0,40.0,0);
And here ur commands:
pawn Код:
if (strcmp("/back", cmdtext, true, 4) == 0)
    {
        TogglePlayerControllable(playerid,1);
        Delete3DTextLabel(Paused[playerid]);
        SendClientMessage(playerid,COLOR_PINK,"[Pause] You are not Paused Anymore !");
        return 1;
    }
    if (strcmp("/afk", cmdtext, true, 3) == 0)
    {
        Attach3DTextLabelToPlayer(Paused[playerid], playerid, 0.0, 0.0, 0.7);
        TogglePlayerControllable(playerid,0);
        SendClientMessage(playerid,COLOR_PINK,"[Pause] You are Paused!");
        return 1;
    }



Re: Attached Label cant delete - Mark™ - 01.05.2012

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
pawn Код:
if (strcmp("/back", cmdtext, true, 4) == 0)
    {
        TogglePlayerControllable(playerid,1);
        Delete3DTextLabel(Paused[playerid]);
        SendClientMessage(playerid,COLOR_PINK,"[Pause] You are not Paused Anymore !");
        return 1;
    }
    if (strcmp("/afk", cmdtext, true, 3) == 0)
    {
        Attach3DTextLabelToPlayer(Paused[playerid], playerid, 0.0, 0.0, 0.7);
        TogglePlayerControllable(playerid,0);
        SendClientMessage(playerid,COLOR_PINK,"[Pause] You are Paused!");
        return 1;
    }
pawn Код:
if (strcmp("/back", cmdtext, true, 5) == 0) // strcmp also considers "/" when it compares the length of the string
    {
        TogglePlayerControllable(playerid,1);
        Delete3DTextLabel(Paused[playerid]);
        SendClientMessage(playerid,COLOR_PINK,"[Pause] You are not Paused Anymore !");
        return 1;
    }
    if (strcmp("/afk", cmdtext, true, 4) == 0) // strcmp also considers "/" when it compares the length of the string
    {
        Attach3DTextLabelToPlayer(Paused[playerid], playerid, 0.0, 0.0, 0.7);
        TogglePlayerControllable(playerid,0);
        SendClientMessage(playerid,COLOR_PINK,"[Pause] You are Paused!");
        return 1;
    }