Delete 3d text on spawn!!
#1

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.

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);

}
regards...
Reply
#2

does someone know what i am doing wrong?
Pls help
Reply
#3

I also have this f***** problem....
Reply
#4

pawn Код:
//Public onplayerconnect
AdminLabel[playerid] = Create3DTextLabel(" ", 0x00000000, 0.0, 0.0, 0.0, 50.0, -1, 0);
Reply
#5

mhh this also does not work.
Any other ideas?
Please this is very important.
Reply
#6

new PlayerText3D:AdminLabel[MAX_plAYERS];

CreatePlayer3DTextLabel()
DeletePlayer3DTextLabel()
UpdatePlayer3DTextLabelText()
Reply
#7

You can make that too :
pawn Код:
new Text3D:AdminLable[ MAX_PLAYERS ], AdminDuty[ MAX_PLAYERS ];
pawn Код:
COMMAND:adminlable(playerid, params[])
{
    if(Spieler[playerid][AdminLevel] > 0) return SendClientMessage(playerid,RED,"You need to be level 1 to use this command!");
    if( AdminDuty[ playerid ] == 0 )
    {
        AdminLable[ playerid ] = 1;
        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);
        return SendClientMessage(playerid, Yellow, "You are now AdminDuty!");
    }
    else
    {
        AdminDuty[ playerid ] = 0;
        Delete3DTextLabel( AdminLable[ playerid ] );
        return SendClientMessage(playerid, Yellow, "You are not now AdminDuty!");
    }
}
I dont know, is that working, but try
If you dont know, how to use ZCMD, then send me PM, i teach
Reply
#8

pawn Код:
new Text3D:AdminLabel[MAX_PLAYERS];

//OnPlayerDosconnect
Update3DTextLabelText(AdminLabel[playerid], 0xFFFFFFFF, " ");

//OnPlayerSpawn
if(Spieler[playerid][AdminLevel] < 0)
{
    Update3DTextLabelText(AdminLabel[playerid], 0xFFFFFFFF, " ");
}
else if(Spieler[playerid][AdminLevel] < 1)
{
    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);
}
Reply
#9

thx alot for ur help so far
this stupid 3d text label still appears above the heads of non admin players.
Where is the error?
Someone knows?
Reply
#10

Someone has another idea?
Cause this is also unfortunately not working
Pls help, i dont know what else to do anymore
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)