Hide players name? (Mask)
#3

This is if you want to be able to toggle names on and off for a player.

Add this at the top of your script:
Код:
new bool:Masked[MAX_PLAYERS] = false;
new OldName[MAX_PLAYER_NAME][MAX_PLAYERS];
Then we can start by adding the command. I'll be using Zcmd but it shoudn't be hard to convert it to the way you want.
Код:
CMD:mask(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(Masked[playerid] == false)
        {
            new pname[24];
            GetPlayerName(playerid, pname, sizeof(pname));
            Masked[playerid] = true;
            strmid(OldName[playerid], pname, 0, strlen(pname), 64);
            SetPlayerName(playerid, "The Stranger");
            SendClientMessage(playerid, COLOR_GREEN, "* You have put on your mask.");
            for(new i=0;i<MAX_PLAYERS;i++)
            {
                ShowPlayerNameTagForPlayer(i, playerid, 0);
            }
        }
        else
        {
            SetPlayerName(playerid, OldName[playerid]);
            Masked[playerid] = false;
            SendClientMessage(playerid, COLOR_GREEN, "* You have removed your mask.");
            for(new i=0;i<MAX_PLAYERS;i++)
            {
                ShowPlayerNameTagForPlayer(i, playerid, 1);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Hide players name? (Mask) - by Cena44 - 17.08.2012, 19:33
Re: Hide players name? (Mask) - by Cena44 - 17.08.2012, 19:42
Re: Hide players name? (Mask) - by aintaro - 17.08.2012, 19:48
Re: Hide players name? (Mask) - by Jay. - 17.08.2012, 20:27
Re: Hide players name? (Mask) - by FireCat - 17.08.2012, 20:28
Re: Hide players name? (Mask) - by kbalor - 17.08.2012, 20:42
Re: Hide players name? (Mask) - by Cena44 - 17.08.2012, 21:23

Forum Jump:


Users browsing this thread: 1 Guest(s)