13.03.2011, 20:26
hi,
if a player is admin, a 3d text label is attached to this player at spawn.
BUt if this admin now disconnects and another player connects and gets the admin's samp id, the admin 3d text label will be attached to this no admin player as well.
So how to prevent that?
I've also tried to delete or update the label to " " (nothing) if the player is no admin but nothing works!
I've also tried to delete this label under OnPlayerDisconnect. Also does not work.
regards...
if a player is admin, a 3d text label is attached to this player at spawn.
BUt if this admin now disconnects and another player connects and gets the admin's samp id, the admin 3d text label will be attached to this no admin player as well.
So how to prevent that?
I've also tried to delete or update the label to " " (nothing) if the player is no admin but nothing works!
I've also tried to delete this label under OnPlayerDisconnect. Also does not work.
pawn Код:
new Text3D:AdminLabel[MAX_PLAYERS];
//OnPlayerDosconnect
Delete3DTextLabel(AdminLabel[playerid]);
//OnPlayerSpawn
if(Spieler[playerid][AdminLevel] < 0)// if player is no admin
{
Delete3DTextLabel(AdminLabel[playerid]);
}
else if(Spieler[playerid][AdminLevel] > 0)// if player is admin
{
Add3DTextLabelToAdmin(playerid);
}
stock Add3DTextLabelToAdmin(playerid)
{
AdminLabel[playerid] = Create3DTextLabel("{FF007F}A{FF0000}d{FF007F}m{FF0000}i{FF007F}n",0xF97804FF,30.0,40.0,50.0,30,-1,1);
Attach3DTextLabelToPlayer(AdminLabel[playerid], playerid, 0.0, 0.0, 0.7);
}