warning in aod cmd
#1

this is my cmd,
i have warning of Tag mismatch
Код:
new Text3D:textlabel;
CMD:aod(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		if(AdminDuty[playerid] == 0)
		{
			new str[256], pname[MAX_PLAYER_NAME];
			SetPlayerHealth(playerid, 999999);
			SCM(playerid, PURPLE, "You are now admin on duty");
			GetPlayerName(playerid, pname, sizeof(pname));
			format(str, sizeof(str), "Admin %s Is now on duty, please don't kill him",pname);
			SCMToAll(BLUE, str);
			SetPlayerColor(playerid, 0x6849B1AA);
			textlabel = Create3DTextLabel("Admin on duty", 0xFF0000AA, 0, 0, 0, 30, 0);
			Attach3DTextLabelToPlayer(Text3D:textlabel, playerid, 0, 0, 0.7);
			AdminDuty[playerid] = 1;
		}
		else if(AdminDuty[playerid] == 1)
		{
			DeletePlayer3DTextLabel(playerid, textlabel); //This is the line of error
			SetPlayerHealth(playerid, 100);
			SCM(playerid, PURPLE, "You are now off duty");
			AdminDuty[playerid] = 0;
		}
		return 1;
	}
	else
	{
		SCM(playerid, RED, "You are not allowed to use this command");
	}
	return 1;
}
Reply
#2

PHP код:
new PlayerText3D:textlabel
Player3DTextLabel uses the 'PlayerText3D' tag.

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel
Reply
#3

PHP код:
new Text3D:textlabel[MAX_PLAYERS];
CMD:aod(playerid,params[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(
AdminDuty[playerid] == 0)
        {
            new 
str[256], pname[MAX_PLAYER_NAME];
            
SetPlayerHealth(playerid999999);
            
SCM(playeridPURPLE"You are now admin on duty");
            
GetPlayerName(playeridpnamesizeof(pname));
            
format(strsizeof(str), "Admin %s Is now on duty, please don't kill him",pname);
            
SCMToAll(BLUEstr);
            
SetPlayerColor(playerid0x6849B1AA);
            
textlabel[playerid] = Create3DTextLabel("Admin on duty"0xFF0000AA000300);
            
Attach3DTextLabelToPlayer(textlabel[playerid], playerid000.7);
            
AdminDuty[playerid] = 1;
        }
        else if(
AdminDuty[playerid] == 1)
        {
            
Delete3DTextLabel(textlabel[playerid]); //This is the line of error
            
SetPlayerHealth(playerid100);
            
SCM(playeridPURPLE"You are now off duty");
            
AdminDuty[playerid] = 0;
        }
        return 
1;
    }
    else
    {
        
SCM(playeridRED"You are not allowed to use this command");
    }
    return 
1;

Try that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)