/mask command?
#1

hello does anyone know how to code a mask command for the hitman faction?

/mask on
/mask off
would be great!
Reply
#2

pawn Код:
new masked[playerid];
if(strcmp(cmd, "/mask", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(masked[playerid])
            {
                for(new i = 0; i < MAX_ONLINE_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 0);
                    }
                }
                masked[playerid] = true;
                GameTextForPlayer(playerid, "~r~Masked", 1000, 4);
            }
            else
            {
                for(new i = 0; i < MAX_ONLINE_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 1);
                    }
                }
                masked[playerid] = false;
                GameTextForPlayer(playerid, "~g~Unmasked", 1000, 4);
            }
        }
        return 1;
    }
Just add a statement to check if the player is a member of the hitmen faction.
Reply
#3

Which command processor? strcmp? dcmd? ycmd? zcmd?

You can simply put something like UsingMask[playerid] = 1; into your command, and then ask OnPlayerStreamIn (when a player sees the other one):

Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    if(UsingMask[playerid] == 1) { ShowPlayerNameTagForPlayer(playerid, forplayerid, 0); }
    return 1;
}
If you tell me your command processor I'll show you how.


EDIT: The problem is if people connect to your server after you used your command, OnPlayerStreamIn has to make sure nobody sees your tag after reconnecting.
Reply
#4

zcmd
Reply
#5

these don't work.
Reply
#6

bump.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)