[Help] NameTags
#15

Step-to-step:
1) Define dcmd: add this to the top (if you don't already have it)
Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
2) Add sscanf to your script (if you don't already have it): GET SSCANF HERE

3) Go to your OnPlayerCommandText, and add
pawn Код:
dcmd(mask, 4, cmdtext);
4) Add this somewhere to your script, anywhere as long as it is not in any other callback:
pawn Код:
dcmd_mask(playerid, params[])
{
    new userid;
    if (sscanf(params, "u", userid) != 0) return SendClientMessage(playerid, SOME_COLOR, "USAGE: /mask [playerid or name]");
    if (IsPlayerConnected(userid))
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            ShowPlayerNameTagForPlayer(i, userid, false);
        }
        if (userid != playerid) SendClientMessage(playerid, SOME_COLOR, "[SUCCESS] Target player is now masked!");
        SendClientMessage(userid, SOME_COLOR, "You have been masked!");
    }
    else SendClientMessage(playerid, SOME_COLOR, "[FAIL] Target player is not connected!");
    return 1;
}
Now you should be able to make an unmask command easily!
Reply


Messages In This Thread
[Help] NameTags - by joeri55 - 14.09.2009, 14:00
Re: [Help] NameTags - by Correlli - 14.09.2009, 14:02
Re: [Help] NameTags - by Calgon - 14.09.2009, 14:03
Re: [Help] NameTags - by joeri55 - 14.09.2009, 15:01
Re: [Help] NameTags - by Correlli - 14.09.2009, 15:02
Re: [Help] NameTags - by joeri55 - 14.09.2009, 15:09
Re: [Help] NameTags - by Correlli - 14.09.2009, 15:11
Re: [Help] NameTags - by Calgon - 14.09.2009, 15:11
Re: [Help] NameTags - by joeri55 - 14.09.2009, 15:31
Re: [Help] NameTags - by Clavius - 14.09.2009, 15:35
Re: [Help] NameTags - by joeri55 - 14.09.2009, 15:57
Re: [Help] NameTags - by Calgon - 14.09.2009, 16:08
Re: [Help] NameTags - by joeri55 - 14.09.2009, 16:26
Re: [Help] NameTags - by Correlli - 14.09.2009, 16:31
Re: [Help] NameTags - by Clavius - 14.09.2009, 16:36
Re: [Help] NameTags - by joeri55 - 14.09.2009, 17:18
Re: [Help] NameTags - by joeri55 - 14.09.2009, 17:39
Re: [Help] NameTags - by Calgon - 14.09.2009, 17:56
Re: [Help] NameTags - by joeri55 - 14.09.2009, 18:03

Forum Jump:


Users browsing this thread: 1 Guest(s)