Trying to make player nametags hide when they're crouched.
#4

Quote:
Originally Posted by ATGOggy
View Post
Try this:
PHP Code:
if ((newkeys KEY_CROUCH) && !(oldkeys KEY_CROUCH))
    {
        if(
GameStatus == && IsReady[playerid] == true)
        {
            if(
PlayerCurrentlyCrouched[playerid] == false// Not currently crouching.
            
{
                
PlayerCurrentlyCrouched[playerid] = true;
                for(new 
i=0MAX_PLAYERSi++)
                {
                    
ShowPlayerNameTagForPlayer(playeridi0); 
                }
            }
            if(
PlayerCurrentlyCrouched[playerid] == true// If the player's crouching.
            
{
                
PlayerCurrentlyCrouched[playerid] = true;
                for(new 
i=0MAX_PLAYERSi++)
                {
                    
ShowPlayerNameTagForPlayer(playeridi1);
                }
            }
            
        }
    }
public 
OnPlayerStreamIn(playeridforplayerid)
{
    if(
IsPlayerCurrentlyCrouched[playerid])
    {
        
ShowNameTagFprPlayer(playeridforplayerid0);
    }
    return 
1;

Thank you. My friend and I tried testing it before onplayerstreamin, and it didn't work. We'll try testing it with it in about an hour or so.

Quote:
Originally Posted by Abagail
View Post
You also need to hide nametags for streaming in players if you aren't already as a side note. Otherwise, print debug statements to see if the code actually gets executed.
Will try. Thank you.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)