Masks.
#1

Could somebody help me with making a /mask command, where it stores there name, and when they /unmask it puts there name back to how it was? Thank you, and all help is greatly appreciated.
Reply
#2

Do you mean hide their nametag? If so, then you are probably looking for something like this:

pawn Код:
if(strcmp(cmdtext, "/mask", true) == 0) {
        for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
        GameTextForPlayer(playerid, "~W~Wearing mask.", 5000, 5);
        return 1;
    }
if(strcmp(cmdtext, "/unmask", true) == 0) {
        for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
        GameTextForPlayer(playerid, "~W~Not wearing mask.", 5000, 5);
        return 1;
    }
Add it under OnPlayerCommandText.
Reply
#3

Thanks, but it wasn't what I was looking for, but it will do
Reply
#4

pawn Код:
new playernames[MAX_PLAYERS][MAX_PLAYER_NAME];

// ... prumpuz edit

if(strcmp(cmdtext, "/mask", true) == 0) {
        GetPlayerName(playerid, playernames[playerid]);
        for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, false);
        GameTextForPlayer(playerid, "~W~Wearing mask.", 5000, 5);
        return 1;
    }
if(strcmp(cmdtext, "/unmask", true) == 0) {
        if(strlen(playernames[playerid])) SetPlayerName(playerid, playernames[playerid]);
        for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
        GameTextForPlayer(playerid, "~W~Not wearing mask.", 5000, 5);
        return 1;
    }
Would be what you are looking for then i think
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)