NameTag Hide For everyone!
#1

Hello everyone ,

I was thinking to code a command for Admins Level 6+ which can hide everyone's NameTag For Everyone!

The Command will : Hide the playerid's NameTag For All as well as will hide Everyone's NameTag for the playerid also. This can be done by using a loop i guess maybe two.

But as far as i know Maybe ill need two loop's! First area will hide Player's nametag for everyone [i in the loop]
Second will Hide nametag for playerid of i.

How to hide nametag of other's for others? I guess Good Scripters will be able to get me.
This is what ive coded just now! Hope it helps

pawn Код:
if (strcmp(cmd, "/nametag", true)==0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 6)
        {
            if(HideNameTag == 0)
            {
                for(new i = 0; i <= MAX_PLAYERS; i++)
                {
                    for(new x = MAX_PLAYERS; x <= MAX_PLAYERS; x--)
                    {
                        ShowPlayerNameTagForPlayer(x, i, false);
                    }
                }
                GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
                HideNameTag = 1;
            }
            else
            {
                for(new i = 0; i <= MAX_PLAYERS; i++)
                {
                    for(new x = MAX_PLAYERS; x <= MAX_PLAYERS; x--)
                    {
                        ShowPlayerNameTagForPlayer(x, i, true);
                    }
                }
                HideNameTag = 0;
            }
        }
        else return SendClientMessage(playerid,COLOR_GRAD2,"Your not Ballu Miaa who can do anything he want's! Get the fuck off Dude!.");
        return 1;
    }
Now Consider only 10 people in the server playerid 0 -10. So the output will be like
Код:
0 - 10 - HIdes 10's Nametag for 0
1 - 9 - HIdes 9's Nametag for 1
2 - 8 - HIdes 8's Nametag for 2
3 - 7 - HIdes 7's Nametag for 3
4 - 6 - HIdes 6's Nametag for 4
5 - 5 - HIdes 5's Nametag for 5
6 - 4 - HIdes 4's Nametag for 6
7 - 3 - HIdes 3's Nametag for 7
8 - 2 - HIdes 2's Nametag for 8 
9 - 1 - HIdes 1's Nametag for 9
10 - 0 - HIdes 0's Nametag for 10
This is not what i want to do! What i want is that will Hide NameTag of 0 for everyone, then of playerid 1 for everyone then playerid 2's nametag hidden for everyone. and so on!

If you can give me the correct loop or something. Please help me. Im pretty confused with this!
Reply
#2

pawn Код:
if (strcmp(cmd, "/nametag", true)==0)
{
        if(PlayerInfo[playerid][pAdmin] >= 6)
        {
            if(HideNameTag == 0)
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    for(new x = 0; x < MAX_PLAYERS; x++)
                    {
                        if(IsPlayerConnected(i)&&IsPlayerConnected(x))
                        {
                            ShowPlayerNameTagForPlayer(x, i, false);
                        }
                    }
                }
                GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
                HideNameTag = 1;
            }
            else
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    for(new x = 0; x < MAX_PLAYERS; x++)
                    {
                        if(IsPlayerConnected(i)&&IsPlayerConnected(x))
                        {
                            ShowPlayerNameTagForPlayer(x, i, true);
                        }
                    }
                }
                HideNameTag = 0;
            }
        }
        else return SendClientMessage(playerid,COLOR_GRAD2,"Your not Ballu Miaa who can do anything he want's! Get the fuck off Dude!.");
        return 1;
}
Reply
#3

pawn Код:
if (strcmp(cmd, "/nametag", true)==0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 6)
        {
            if(HideNameTag == 0)
            {
                for(new x; x<MAX_PLAYERS; x++)
                {
                    if(!IsPlayerConnected(x)) continue;
                    for(new i; i<MAX_PLAYERS; i++)
                    {
                        if(i == x || !IsPlayerConnected(x)) continue;
                        ShowPlayerNameTagForPlayer(i, x, 0);
                    }
                }
                GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
                HideNameTag = 1;
            }
            else
            {
                for(new x; x<MAX_PLAYERS; x++)
                {
                        if(!IsPlayerConnected(x)) continue;
                        for(new i; i<MAX_PLAYERS; i++)
                       {
                           if(i == x || !IsPlayerConnected(x)) continue;
                           ShowPlayerNameTagForPlayer(i, x, 1);
                       }
                }
                HideNameTag = 0;
            }
        }
        else return SendClientMessage(playerid,COLOR_GRAD2,"Your not Ballu Miaa who can do anything he want's! Get the fuck off Dude!.");
        return 1;
    }
Give that a go
Reply
#4

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
pawn Код:
if (strcmp(cmd, "/nametag", true)==0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 6)
        {
            if(HideNameTag == 0)
            {
                for(new x; x<MAX_PLAYERS; x++)
                {
                    if(!IsPlayerConnected(x)) continue;
                    for(new i; i<MAX_PLAYERS; i++)
                    {
                        if(i == x || !IsPlayerConnected(x)) continue;
                        ShowPlayerNameTagForPlayer(i, x, 0);
                    }
                }
                GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
                HideNameTag = 1;
            }
            else
            {
                for(new x; x<MAX_PLAYERS; x++)
                {
                        if(!IsPlayerConnected(x)) continue;
                        for(new i; i<MAX_PLAYERS; i++)
                       {
                           if(i == x || !IsPlayerConnected(x)) continue;
                           ShowPlayerNameTagForPlayer(i, x, 1);
                       }
                }
                HideNameTag = 0;
            }
        }
        else return SendClientMessage(playerid,COLOR_GRAD2,"Your not Ballu Miaa who can do anything he want's! Get the fuck off Dude!.");
        return 1;
    }
Give that a go
That can work i guess bro! Thanks for the reply. Do u think that will remove everyone's nametag for everyone!? btw code seems pretty fine to me
Reply
#5

hic u the man i posted like same results...

lol why troll so much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)