ShowPlayerNameTag
#4

pawn Код:
// Somewhere in your script
new NameTag[MAX_PLAYERS];


if (strcmp("/nameoff", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
        ShowPlayerNameTagForPlayer(i, playerid, false);
       
    NameTag[playerid] = 0;
    GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5);
    return 1;
}
if (strcmp("/nameon", cmdtext, true) == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
        ShowPlayerNameTagForPlayer(i, playerid, true);
       
    NameTag[playerid] = 1;
    GameTextForPlayer(playerid, "~W~Nametags ~G~ON", 5000, 5);
    return 1;
}

public OnPlayerConnect(playerid)
{
    NameTag[playerid] = 1;
    for(new i = 0; i < MAX_PLAYERS; i++)
        if(NameTag[i] == 0)
            ShowPlayerNameTagForPlayer(playerid, i, false);

    return 1;
}
Remember, this only disables / enables name tag for online players. If you want to hide names to players who joins the server, you have to create a variables
Reply


Messages In This Thread
ShowPlayerNameTag - by kbalor - 17.09.2012, 21:00
Re: ShowPlayerNameTag - by SmithyComp - 17.09.2012, 21:13
Re: ShowPlayerNameTag - by ViniBorn - 17.09.2012, 21:13
Re: ShowPlayerNameTag - by antonio112 - 17.09.2012, 21:14

Forum Jump:


Users browsing this thread: 1 Guest(s)