Headtext Bug +REP
#1

Hi Guys i can't fix that bug someoen can help me well when i'm /aduty the headtext show 100% when i try to be offduty the text still there help

Код:
//variables
new Text3D:label;
Код:
CMD:aduty(playerid)
{
	if(pInfo[playerid][pLogged] == 1)
	{
		if(pInfo[playerid][pAdminLevel] >= 1)
		{
			if(pInfo[playerid][pAdminDuty] == 0)
			{
			pInfo[playerid][pAdminDuty] = 1;

			new adutyonstring[128];
			format(adutyonstring, sizeof(adutyonstring), "{F3FF02}Admin %s is now on duty [DO NOT ATTACK HIM]" ,PlayerName(playerid));
			label = Create3DTextLabel("Admin On Duty.", 0xFFC70855, 30.0, 40.0, 50.0, 40.0, 0);
            Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
			SendClientMessageToAll(-1,adutyonstring);
			SetPlayerSkin(playerid,126);
			ResetPlayerWeapons(playerid);
			SetPlayerColor(playerid,COLOR_ADUTY);
			SetPlayerHealth(playerid,9999);
			SendClientMessage(playerid,COLOR_RED,"Remember to /aduty when you play as regular player.");
			}
			else
			{
				if(pInfo[playerid][pAdminDuty] == 1)
				{
				pInfo[playerid][pAdminDuty] = 0;
				new adutyoffstring[128];
				format(adutyoffstring, sizeof(adutyoffstring), "{F3FF02}Admin %s is now off admin duty" ,PlayerName(playerid));
                DeletePlayer3DTextLabel(playerid, label);
				SendClientMessageToAll(-1,adutyoffstring);
I Will Continue with Return... I Know
Reply
#2

show the variable for the text please
Reply
#3

Done
Reply
#4

can you show me full aduty command ?
Reply
#5

Here:


Код:
CMD:aduty(playerid)
{
	if(pInfo[playerid][pLogged] == 1)
	{
		if(pInfo[playerid][pAdminLevel] >= 1)
		{
			if(pInfo[playerid][pAdminDuty] == 0)
			{
			pInfo[playerid][pAdminDuty] = 1;

			new adutyonstring[128];
			format(adutyonstring, sizeof(adutyonstring), "{F3FF02}Admin %s is now on duty [DO NOT ATTACK HIM]" ,PlayerName(playerid));
			label = Create3DTextLabel("Admin On Duty.", 0xFFC70855, 30.0, 40.0, 50.0, 40.0, 0);
            Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
			SendClientMessageToAll(-1,adutyonstring);
			SetPlayerSkin(playerid,126);
			ResetPlayerWeapons(playerid);
			SetPlayerColor(playerid,COLOR_ADUTY);
			SetPlayerHealth(playerid,9999);
			SendClientMessage(playerid,COLOR_RED,"Remember to /aduty when you play as regular player.");
			}
			else
			{
				if(pInfo[playerid][pAdminDuty] == 1)
				{
				pInfo[playerid][pAdminDuty] = 0;
				new adutyoffstring[128];
				format(adutyoffstring, sizeof(adutyoffstring), "{F3FF02}Admin %s is now off admin duty" ,PlayerName(playerid));
                DeletePlayer3DTextLabel(playerid, label);
				SendClientMessageToAll(-1,adutyoffstring);

				if(team[playerid] == TEAM_ZOMBIE)
				{
					SetPlayerColor(playerid,COLOR_ZOMBIE);
				}
				if(team[playerid] == TEAM_HUMAN)
				{
					SetPlayerColor(playerid,COLOR_HUMAN);
				}
				SetPlayerHealth(playerid,100);
				}
			}
		}
	}
    else if(pInfo[playerid][pLogged] == 0)
	{
		SendClientMessage(playerid,-1,""chat""COL_ORANGE" You Are Not Logged In");
		printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
		Kick(playerid);
	}
	return 1;
}
Reply
#6

2 h passed

Help ?
Reply
#7

use "new label[MAX_PLAYERS];" instead of "new label;"

helpfull?
Reply
#8

believe me i already did that and still doesn"t work
Reply
#9

then use Update3DTextLabelText(label[playerid], 0xFFFFFFFF, " ");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)