[FIXED]3D label help - 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: [FIXED]3D label help (
/showthread.php?tid=563938)
[FIXED]3D label help -
Nabster - 18.02.2015
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;
}
Re: 3D label help -
HazardouS - 18.02.2015
admintextid has to be Text3D, not PlayerText3D, this is the mismatch. Read this:
https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer
Re: 3D label help -
Nabster - 18.02.2015
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..
Re: 3D label help -
HazardouS - 18.02.2015
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.
Re: 3D label help -
Nabster - 18.02.2015
Thanks,fixed now.