SA-MP Forums Archive
warning in aod cmd - 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: warning in aod cmd (/showthread.php?tid=636259)



warning in aod cmd - HoussemGaming - 23.06.2017

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



Re: warning in aod cmd - Threshold - 23.06.2017

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

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel


Re: warning in aod cmd - oSAINTo - 24.06.2017

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.