SA-MP Forums Archive
Masks. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Masks. (/showthread.php?tid=258295)



Masks. - iGetty - 29.05.2011

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.


Re: Masks. - Prumpuz - 29.05.2011

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.


Re: Masks. - iGetty - 29.05.2011

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


Re: Masks. - Mauzen - 30.05.2011

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