Masks.
#1

How could I make so when a player does /mask it sets there name to Stranger 1/2/3/4/etc..
and also, when they /unmask there names go back to normal? Thanks in advance.
Reply
#2

/mask
Save the name in a pvar of array
Change the player name to StrangerUNIQUEID also StrangerPLAYERID
/unmask
Give the old name back which is stored

The only problem I see is that someone could rejoin the server with your real name!
But that can be prevented if you add a check in OnPlayerUpdate if the name is saved
Reply
#3

pawn Код:
command(mask, playerid, params[])
{
    new str[24],string[124];
    GetPlayerName( playerid , str , 24 );
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(playermask[playerid] = 0)
            {
                ShowPlayerNameTagForPlayer(i, playerid, 0);
                format(string, sizeof(string),"%s you have put a mask");
            }
            else if(playermask[playerid] = 1)
            {
                ShowPlayerNameTagForPlayer(i, playerid, 1);
                format(string, sizeof(string),"%s you have take off your mask");
            }
        }
    }
    SendClientMessage(playerid,0x9EC73DAA,string);
    return 1;
}
Now you should improve that code

EDIT: top gm new playermask[MAX_PLAYERS];

You can create mask ids trought the playerid for exemple some the player id with a random number and store the number in a player variable them you subtract the var for future admin cmds or other features
Reply
#4

Quote:
Originally Posted by Hornet600
Посмотреть сообщение
pawn Код:
command(mask, playerid, params[])
{
    new str[24],string[124];
    GetPlayerName( playerid , str , 24 );
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(playermask[playerid] = 0)
            {
                ShowPlayerNameTagForPlayer(i, playerid, 0);
                format(string, sizeof(string),"%s you have put a mask");
            }
            else if(playermask[playerid] = 1)
            {
                ShowPlayerNameTagForPlayer(i, playerid, 1);
                format(string, sizeof(string),"%s you have take off your mask");
            }
        }
    }
    SendClientMessage(playerid,0x9EC73DAA,string);
    return 1;
}
Now you should improve that code

EDIT: top gm new playermask[MAX_PLAYERS];

You can create mask ids trought the playerid for exemple some the player id with a random number and store the number in a player variable them you subtract the var for future admin cmds or other features
pawn Код:
C:\Documents and Settings\d\Desktop\lvrp\Windows\gamemodes\VortexRoleplay.pwn(10917) : warning 211: possibly unintended assignment
C:\Documents and Settings\d\Desktop\lvrp\Windows\gamemodes\VortexRoleplay.pwn(10922) : warning 211: possibly unintended assignment
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
Reply
#5

pawn Код:
new playermask[MAX_PLAYERS];
Reply
#6

I put that, already.. It was because of the =, it was supposed to be two =='s Thanks anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)