[FIXED]3D label help
#1

getting tag mismatch error on attach3dtext

Код:
CMD:adminduty(playerid,params[])
{
	new string[128],pName[MAX_PLAYER_NAME];
	new Float:X, Float:Y, Float:Z;
	new PlayerText3D:admintextid;
	if(PInfo[playerid][Level] < 1)
    return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 1 to go on admin duty.");
    CMDMessageToAdmins(playerid,"ADMINDUTY");
    if(PInfo[playerid][God] == 0)
	{
   	    	PInfo[playerid][God] = 1;
    	    SetPlayerHealth(playerid,100000);
    	    SetPlayerSkin(playerid,217);
    	    ResetPlayerWeapons(playerid);
			GetPlayerName(playerid,pName,sizeof pName);
			format(string,sizeof(string),"Administrator %s is now on Admin Duty.",pName);
			SendClientMessageToAll(COLOR_MENUHIGHLIGHT,string);
			admintextid = CreatePlayer3DTextLabel(playerid,"!!ADMIN ON DUTY!!",COLOR_GREEN,X,Y,Z,40.0);
			Attach3DTextLabelToPlayer(admintextid, playerid, 0.0, 0.0, 0.7);
	}
	else
	{
   	        PInfo[playerid][God] = 0;
       	    GetPlayerName(playerid,pName,sizeof pName);
			format(string,sizeof(string),"Administrator %s is now off Admin Duty.",pName);
			SendClientMessageToAll(COLOR_MENUHIGHLIGHT,string);
        	SetPlayerHealth(playerid,0.0);
        	DeletePlayer3DTextLabel(playerid,admintextid);
    }
    return 1;
}
Reply
#2

admintextid has to be Text3D, not PlayerText3D, this is the mismatch. Read this: https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer
Reply
#3

so what 3dtextforplayer do?

EDIT:

Код:
CMD:adminduty(playerid,params[])
{
	new string[128],pName[MAX_PLAYER_NAME];
	if(PInfo[playerid][Level] < 1)
    return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 1 to go on admin duty.");
    CMDMessageToAdmins(playerid,"ADMINDUTY");
    if(PInfo[playerid][God] == 0)
	{
   	    	PInfo[playerid][God] = 1;
    	    SetPlayerHealth(playerid,100000);
    	    SetPlayerSkin(playerid,217);
    	    ResetPlayerWeapons(playerid);
			GetPlayerName(playerid,pName,sizeof pName);
			format(string,sizeof(string),"Administrator %s is now on Admin Duty.",pName);
			SendClientMessageToAll(COLOR_MENUHIGHLIGHT,string);
			new Text3D:label = Create3DTextLabel("!!ADMIN ON DUTY!!",COLOR_GREEN,30.0, 40.0, 50.0, 40.0, 0);
			Attach3DTextLabelToPlayer(label,playerid,0.0,0.0,0.7);
	}
	else
	{
   	        PInfo[playerid][God] = 0;
       	    GetPlayerName(playerid,pName,sizeof pName);
			format(string,sizeof(string),"Administrator %s is now off Admin Duty.",pName);
			SendClientMessageToAll(COLOR_MENUHIGHLIGHT,string);
        	SetPlayerHealth(playerid,0.0);
        	DeletePlayer3DTextLabel(playerid,label);
    }
    return 1;
}
undefined symbol label in deleteplayer3d..
Reply
#4

Remove all instances of admintextid and Attach function. Use the Create per-player function parameters to attach the text to the player: https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel
Also, declare a global variable to store text3d ids in order to destroy them when the admin goes off-duty.
Reply
#5

Thanks,fixed now.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)