3DTextLabel Issue!!
#6

i do it like in the folowing:

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


//this is under OnPlayerSpawn it adds a rank label to every player also admins
Add3DTextLabelToPlayer(playerid);

//The admin label is added to admins only and only in case they want to go on duty with this cmd
if (strcmp("/onduty", cmdtext, true) == 0)//the admin gets his admin label
{
if(Spieler[playerid][AdminLevel] > 0)
{
Add3DTextLabelToAdmin(playerid);
SendClientMessage(playerid, 0xFF0000FF, "An Admin Text Label has been added. The players now can realize you as an Admin!");
}else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");

return 1;
}

if (strcmp("/offduty", cmdtext, true) == 0)//the admin removes the admin label but heres the error, the normal label //gets removed instead of the admin label.
{
if(Spieler[playerid][AdminLevel] > 0)
{
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;
}

//admin label adding stock function
stock Add3DTextLabelToAdmin(playerid)
{

    AdminLabel[playerid] = Create3DTextLabel("Admin",0xF97804FF,30.0,40.0,50.0,30,-1,0);

    Attach3DTextLabelToPlayer(AdminLabel[playerid], playerid, 0.0, 0.0, 0.7);

}

//normal label for every player adding stock function
stock Add3DTextLabelToPlayer(playerid)
{
           
    NormalLabel[playerid] = Create3DTextLabel("{1464F4}Rank",0xF97804FF,30.0,40.0,50.0,30,-1,0);
    Attach3DTextLabelToPlayer(NormalLabel[playerid], playerid, 0.0, 0.0, 0.5);
    new labelstring[50];
    format(labelstring, sizeof(labelstring), "{1464F4}CTU {20B2AA}%s", RankName[pRank[playerid]]);//rank update
    Update3DTextLabelText(NormalLabel[playerid], 0xF97804FF, labelstring);
}
//sorry for the double post
Reply


Messages In This Thread
3DTextLabel Issue!! - by BlackWolf120 - 14.02.2011, 20:51
Re: 3DTextLabel Issue!! - by BlackWolf120 - 15.02.2011, 16:51
Re: 3DTextLabel Issue!! - by Geso - 15.02.2011, 17:00
Re: 3DTextLabel Issue!! - by xxmitsu - 15.02.2011, 17:05
Re: 3DTextLabel Issue!! - by BlackWolf120 - 15.02.2011, 17:08
Re: 3DTextLabel Issue!! - by BlackWolf120 - 15.02.2011, 17:17
Re: 3DTextLabel Issue!! - by BlackWolf120 - 16.02.2011, 19:10

Forum Jump:


Users browsing this thread: 4 Guest(s)