14.02.2011, 20:51
hi,
im creating some textlabels above the head of every player.
And theres a second label for admins only.
Normal players got only the first label and admins got both of them.
Now it seems that this 2 labels mix up somehow.
Cause I made a command admins can use to hide the admin label. But then it hides the normal first label instead of the admin label. But i didnt mix this label ids up so wheres the error?
regards...
im creating some textlabels above the head of every player.
And theres a second label for admins only.
Normal players got only the first label and admins got both of them.
Now it seems that this 2 labels mix up somehow.
Cause I made a command admins can use to hide the admin label. But then it hides the normal first label instead of the admin label. But i didnt mix this label ids up so wheres the error?
pawn Код:
new Text3D:NormalLabel[MAX_PLAYERS];
new Text3D:AdminLabel[MAX_PLAYERS];
//Normal Label
NormalLabel[playerid] = Create3DTextLabel("Text",0xF97804FF,30.0,40.0,50.0,30,-1,0);
Attach3DTextLabelToPlayer(NormalLabel[playerid], playerid, 0.0, 0.0, 0.5);
//Admin Label
AdminLabel[playerid] = Create3DTextLabel("Admin",0xF97804FF,30.0,40.0,50.0,30,-1,0);
Attach3DTextLabelToPlayer(AdminLabel[playerid], playerid, 0.0, 0.0, 0.7);
//Admin label hide command
if (strcmp("/offduty", cmdtext, true) == 0)
{
if(Player[playerid][AdminLevel] > 0)//checks if player is admin
{
SendClientMessage(playerid, 0xFF0000FF, "The Admin Text Label has been removed. You are a secret admin now.");
Delete3DTextLabel(AdminLabel[playerid]);
}else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
return 1;
}