How to remove the 3dtextlabeltoplayer
#1

How can i remove all the 3dtextlabeltoplayer if the player is a normal player

Код:
public OnPlayerSpawn(playerid)
{
        new Text3D:label1 = Create3DTextLabel("..::[VIP]::..", 0x33CCFFAA, 30.0, 40.0, 50.0, 40.0, 0);
        new Text3D:label = Create3DTextLabel("..::[ADMIN]::..", 0x99FF00AA, 30.0, 40.0, 50.0, 40.0, 0);
        new Text3D:label2 = Create3DTextLabel("..::[ADMIN]::..", 0x99FF00AA, 30.0, 40.0, 50.0, 40.0, 0);
	TogglePlayerControllable(playerid,1);
	SetPlayerArmour(playerid, 100.0);
	SetPlayerHealth(playerid, 100);
 	if(IsPlayerVipMember(playerid))
	{
	    Attach3DTextLabelToPlayer(label1, playerid, 0.0, 0.0, 0.25);
	    SetPlayerPos(playerid, 3383.0039,2360.2415,8.120);
	    GameTextForPlayer(playerid, "WELCOME HOME VIP", 5000, 6);
	    TogglePlayerControllable(playerid, false);
	    SetTimerEx("Unfreeze", 5000, false, "i", playerid);
	    SetPlayerArmour(playerid, 100.0);
	    SetPlayerHealth(playerid, 100);
            if(IsPlayerLuxAdmin(playerid))
    	    {
	    	   Delete3DTextLabel(label1);
		   Atach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.25);
		   SetPlayerPos(playerid, 3384.6399,2360.1299,2.5485);
	    	   GameTextForPlayer(playerid, "WELCOME HOME ADMIN", 5000, 6);
	 	   TogglePlayerControllable(playerid, false);
	 	   SetTimerEx("Unfreeze", 5000, false, "i", playerid);
	 	   SetPlayerArmour(playerid, 100.0);
	 	   SetPlayerHealth(playerid, 100);
		   if(IsPlayerAdmin(playerid))
		   {
		           Delete3DTextLabel(label);
                           Delete3DTextLabel(label1);
		           Attach3DTextLabelToPlayer(label2, playerid, 0.0, 0.0, 0.25);
			   SetPlayerPos(playerid, 3384.6399,2360.1299,2.5485);
		    	   GameTextForPlayer(playerid, "WELCOME HOME ADMIN", 5000, 6);
		 	   TogglePlayerControllable(playerid, false);
		 	   SetTimerEx("Unfreeze", 5000, false, "i", playerid);
		 	   SetPlayerArmour(playerid, 100.0);
		 	   SetPlayerHealth(playerid, 100);
		   }
             }
	}
	return 1;
}
Reply
#2

PHP код:
public OnPlayerSpawn(playerid)
{
        new 
Text3D:label1 Create3DTextLabel("..::[VIP]::.."0x33CCFFAA30.040.050.040.00);
        new 
Text3D:label Create3DTextLabel("..::[ADMIN]::.."0x99FF00AA30.040.050.040.00);
        new 
Text3D:label2 Create3DTextLabel("..::[ADMIN]::.."0x99FF00AA30.040.050.040.00);
    
TogglePlayerControllable(playerid,1);
    
SetPlayerArmour(playerid100.0);
    
SetPlayerHealth(playerid100);
     if(
IsPlayerVipMember(playerid))
    {
        
Attach3DTextLabelToPlayer(label1playerid0.00.00.25);
        
SetPlayerPos(playerid3383.0039,2360.2415,8.120);
        
GameTextForPlayer(playerid"WELCOME HOME VIP"50006);
        
TogglePlayerControllable(playeridfalse);
        
SetTimerEx("Unfreeze"5000false"i"playerid);
        
SetPlayerArmour(playerid100.0);
        
SetPlayerHealth(playerid100);
            if(
IsPlayerLuxAdmin(playerid))
            {
               
Delete3DTextLabel(label1);
           
Atach3DTextLabelToPlayer(labelplayerid0.00.00.25);
           
SetPlayerPos(playerid3384.6399,2360.1299,2.5485);
               
GameTextForPlayer(playerid"WELCOME HOME ADMIN"50006);
            
TogglePlayerControllable(playeridfalse);
            
SetTimerEx("Unfreeze"5000false"i"playerid);
            
SetPlayerArmour(playerid100.0);
            
SetPlayerHealth(playerid100);
           if(
IsPlayerAdmin(playerid))
           {
                   
Delete3DTextLabel(label);
                           
Delete3DTextLabel(label1);
                   
Attach3DTextLabelToPlayer(label2playerid0.00.00.25);
               
SetPlayerPos(playerid3384.6399,2360.1299,2.5485);
                   
GameTextForPlayer(playerid"WELCOME HOME ADMIN"50006);
                
TogglePlayerControllable(playeridfalse);
                
SetTimerEx("Unfreeze"5000false"i"playerid);
                
SetPlayerArmour(playerid100.0);
                
SetPlayerHealth(playerid100);
           }
             }
    }
        else
        {
         
Delete3DTextLabel(label1);
         
Delete3DTextLabel(label);
         
Delete3DTextLabel(label2);
}
    return 
1;

If get error please tell mee
I didnt worked with it in pawn
Reply
#3

Hello!

You should define the label's like this:
PHP код:
new Text3D:label1[MAX_PLAYERS],Text3D:label2[MAX_PLAYERS];//global
public OnPlayerSpawn(playerid)
{
    
TogglePlayerControllable(playerid,1);
    
SetPlayerArmour(playerid100.0);
    
SetPlayerHealth(playerid100);
    if(
IsPlayerVipMember(playerid))
    {
        
label1[playerid] = Create3DTextLabel("..::[VIP]::..",0x33CCFFAA,0.0,0.0,0.0,40.0,0);
        
Attach3DTextLabelToPlayer(label1[playerid],playerid,0.0,0.0,0.25);
        
SetPlayerPos(playerid,3383.0039,2360.2415,8.120);
        
GameTextForPlayer(playerid,"WELCOME HOME VIP"50006);
        
SetTimerEx("Unfreeze"5000false"i"playerid);
        
SetPlayerArmour(playerid100.0);
        
SetPlayerHealth(playerid100);
    }
    if(
IsPlayerLuxAdmin(playerid) || IsPlayerAdmin(playerid))
    {
        
Delete3DTextLabel(label1[playerid]);
        
label2[playerid] = Create3DTextLabel("..::[ADMIN]::.."0x99FF00AA0.00.00.040.00);
        
SetPlayerPos(playerid3384.6399,2360.1299,2.5485);
        
GameTextForPlayer(playerid"WELCOME HOME ADMIN"50006);
        
TogglePlayerControllable(playeridfalse);
          
SetTimerEx("Unfreeze"5000false"i"playerid);
           
SetPlayerArmour(playerid100.0);
          
SetPlayerHealth(playerid100);
    }
    return 
1;

Also it needs if you write it so:
PHP код:
if(IsPlayerLuxAdmin(playerid) || IsPlayerAdmin(playerid)) 
instead of
PHP код:
if(IsPlayerLuxAdmin(playerid))
{
}
if(
IsPlayerAdmin(playerid))
{

Reply


Forum Jump:


Users browsing this thread: