Need help with Attach3DTextLabelToPlayer -
lider1241 - 24.08.2013
I made two commands of /adutyon and /adutyoff for admin from level 3 only, the problem is when admin do /adutyon it make a text above is head but when he do /adutyoff it makes double text... how to resolve it? SS:
YELLOW text /adutyon on RED text /adutyoff = double text
i tried t use the function DeletePlayer3DTextLabel but no succeed...
Re: Need help with Attach3DTextLabelToPlayer -
Cypress - 24.08.2013
Show those both commands if you need help. Otherwise, you are not using the function of deleting the 3D text correctly.
Re: Need help with Attach3DTextLabelToPlayer -
Vanter - 24.08.2013
use Update3DTextLabelText
Re: Need help with Attach3DTextLabelToPlayer -
lider1241 - 24.08.2013
lol i forgot to show you the codes XD:
Vanter - i tried to use Update3DTextLabelText but i dont know how to use that... can you write it for me please?
Код:
CMD:adutyon(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128];
new Text3D:adutyon = Create3DTextLabel("Admin On Duty", COLOR_YELLOW, 30.0, 40.0, 50.0, 40.0, 0);
SetPlayerColor(playerid, 0x00FBFFAA);
SetPlayerHealth(playerid, 99999);
SetPlayerArmour(playerid, 99999);
GivePlayerWeapon(playerid, 38, 60000);
Attach3DTextLabelToPlayer(adutyon, playerid, 0.0, 0.0, 0.3);
format(string, sizeof(string), "The admin %s is on Admin Duty now, If you need support or help just /report to admin (Don't spam or abuse it)", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_CYAN, string);
SendClientMessage(playerid, COLOR_WHITE, "Admin Duty on rules: Max report time to accept or deny is 30 seconds, You must help to players if they request, If you saw a bug, report it to scripter");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
CMD:adutyoff(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128];
new Text3D:adutyoff = Create3DTextLabel("Fuck off (Admin duty off)", COLOR_TWRED, 30.0, 40.0, 50.0, 40.0, 0);
SetPlayerColor(playerid, COLOR_TWWHITE);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
DeletePlayer3DTextLabel(playerid, adutyoff);
Attach3DTextLabelToPlayer(adutyoff, playerid, 0.0, 0.0, 0.3);
format(string, sizeof(string), "The admin %s is off Admin Duty now, If you need support or help just go fuck yourself and dont bother him!", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_TWRED, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
Re: Need help with Attach3DTextLabelToPlayer -
Vanter - 24.08.2013
pawn Код:
new Text3D:aduty
CMD:adutyon(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128];
aduty = Create3DTextLabel("Admin On Duty", COLOR_YELLOW, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(aduty, playerid, 0.0, 0.0, 0.3);
SetPlayerColor(playerid, 0x00FBFFAA);
SetPlayerHealth(playerid, 99999);
SetPlayerArmour(playerid, 99999);
GivePlayerWeapon(playerid, 38, 60000);
format(string, sizeof(string), "The admin %s is on Admin Duty now, If you need support or help just /report to admin (Don't spam or abuse it)", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_CYAN, string);
SendClientMessage(playerid, COLOR_WHITE, "Admin Duty on rules: Max report time to accept or deny is 30 seconds, You must help to players if they request, If you saw a bug, report it to scripter");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
CMD:adutyoff(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128];
aduty = Create3DTextLabel("Fuck off (Admin duty off)", COLOR_TWRED, 30.0, 40.0, 50.0, 40.0, 0);
Update3DTextLabelText(aduty, COLOR_TWRED, string);
SetPlayerColor(playerid, COLOR_TWWHITE);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
format(string, sizeof(string), "The admin %s is off Admin Duty now, If you need support or help just go fuck yourself and dont bother him!", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_TWRED, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
Try this
Re: Need help with Attach3DTextLabelToPlayer -
lider1241 - 24.08.2013
Vanter - error for your code /:
(60637) : error 001: expected token: ";", but found "forward"
lines 60635-60637
Код:
new Text3D:aduty
CMD:adutyon(playerid, params[])
Re: Need help with Attach3DTextLabelToPlayer -
Vanter - 24.08.2013
new Text3D:aduty;
add a ";"
Re: Need help with Attach3DTextLabelToPlayer -
lider1241 - 24.08.2013
Vanter now The admin duty after /adutyoff stay on same condition /:
Re: Need help with Attach3DTextLabelToPlayer -
Dragonsaurus - 24.08.2013
First, if you type adutyon twice with that code, you will have 2 similar labels on your head.
Second, those 3d text labels will get bugged, and maybe show to non admin players.
So I recommend you to create all labels on OnGameModeInit and Destroy them on OnGameModeExit (Same if you are using the filterscripts, just place the code on OnFilterScriptInit and OnFilterScriptExit)
Everytime a player connects, attach the label to him, and everytime a player disconnects, Update the label to " " (Space), so the next player to join with the same ID as a previous admin, won't get a label on his head saying "Fuck Off (Admin Off Duty)"...
Here is the code:
pawn Код:
new Text3D:aduty[MAX_PLAYERS];
public OnGameModeInit() // or public OnFilterScriptInit()
{
for(new i = 0; i < 100; i++) aduty[i] = Create3DTextLabel(" ", 30.0, 40.0, 50.0, 40.0, 0);
return 1;
}
public OnGameModeExit() // or public OnFilterScriptExit()
{
for(new i = 0; i < 100; i++) Delete3DTextLabel(aduty[i]);
return 1;
}
public OnPlayerConnect(playerid)
{
Attach3DTextLabelToPlayer(aduty[playerid], playerid, 0.0, 0.0, 0.3);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Update3DTextLabelText(aduty[playerid], COLOR_YELLOW, " ");
return 1;
}
CMD:adutyon(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128];
Update3DTextLabelText(aduty[playerid], COLOR_YELLOW, "Admin On Duty");
SetPlayerColor(playerid, 0x00FBFFAA);
SetPlayerHealth(playerid, 99999);
SetPlayerArmour(playerid, 99999);
GivePlayerWeapon(playerid, 38, 60000);
format(string, sizeof(string), "The admin %s is on Admin Duty now, If you need support or help just /report to admin (Don't spam or abuse it)", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_CYAN, string);
SendClientMessage(playerid, COLOR_WHITE, "Admin Duty on rules: Max report time to accept or deny is 30 seconds, You must help to players if they request, If you saw a bug, report it to scripter");
}
else SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
CMD:adutyoff(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128];
Update3DTextLabelText(aduty[playerid], COLOR_TWRED, "Fuck Off (Admin Off Duty)");
SetPlayerColor(playerid, COLOR_TWWHITE);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
format(string, sizeof(string), "The admin %s is off Admin Duty now, If you need support or help just go fuck yourself and dont bother him!", GetPlayerNameEx(playerid));
SendClientMessageToAll(COLOR_TWRED, string);
}
else SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
Edit: You don't need to add/change anything here

This was all, easy and not too complicated.
Re: Need help with Attach3DTextLabelToPlayer -
lider1241 - 24.08.2013
Never mind... i think i will give up about the 3Dtextlabel above admin name because its too complicated to make it (even if i saw it on other server i played)
Anyway thanks for help /: