/checkmask doesn't work.
#1

Hello.

So I have a mask system at my server, where players can take on a mask and then it shows Stranger_RandomNumber.

To make this able to work we made a command so admins can check who's behind the mask, the cmd is called /checkmask. However, the cmd doesnt work. It just shows "This MaskID doesn't exist!"

Can someone show me what to do to fix this?

/mask command.
pawn Код:
CMD:mask(playerid, params[])
{
    //new name[MAX_PLAYER_NAME];
    new string[128];
    if (PlayerInfo[playerid][pMaskOwner] == 1)
    {
        if(PlayerInfo[playerid][pMask] == 0)
        {
            new rand = 1000 + random(8999);
            MaskID[playerid] = rand;
            foreach(Player, i)
            {
                ShowPlayerNameTagForPlayer(i, playerid, false);
            }
            PlayerInfo[playerid][pMask] = 1;
            format(string, sizeof(string), "\n\nStranger_%d", MaskID[playerid]);
            MaskLabel[playerid] = CreateDynamic3DTextLabel(string, WHITE, 0, 0, -20, 25, playerid);
            Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, MaskLabel[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.30);
            format(string, sizeof(string), "* %s has put a mask on.", RemoveUnderScore(playerid));
            ProxDetector(15.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        else if(PlayerInfo[playerid][pMask] == 1)
        {
            DestroyDynamic3DTextLabel(MaskLabel[playerid]);
            foreach(Player, i)
            {
                ShowPlayerNameTagForPlayer(i, playerid, true);
            }
            DestroyDynamic3DTextLabel(MaskLabel[playerid]);
            //MaskID[playerid] = 0;
            PlayerInfo[playerid][pMask] = 0;
            format(string, sizeof(string), "* %s has put their mask away.", RemoveUnderScore(playerid));
            ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "You haven't bought a mask.");
    }
    return 1;
}
stock MaskName
pawn Код:
stock MaskName(playerid)
{
    new string[128];
    if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "Stranger %d", MaskID[playerid]);
    else format(string, sizeof(string), "%s", RemoveUnderScore(playerid));
    return string;
}
/checkmask command
pawn Код:
CMD:checkmask(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 0)
    {
        new maski;
        if(sscanf(params, "i", maski)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /checkmask [maskid] ( gives playername&playerid of maskid )");
        {
            if(maski < 1000 || maski > 9999) return SendClientMessageEx(playerid, COLOR_WHITE, "Error: MaskID can't be less than 1000 or higher than 9999.");
            {
                foreach(Player, i)
                {
                    if(MaskID[i] == maski)
                    {
                        if(IsPlayerConnected(i))
                        {
                            new str[120];
                            format(str, sizeof(str), "MaskID %i belongs to %s (%i)", maski, RemoveUnderScore(i), i);
                            SendClientMessageEx(playerid, COLOR_GREEN, str);
                        }
                        else return SendClientMessageEx(playerid, COLOR_WHITE, "Error: No one was found with that MaskID.");
                    }
                    else return SendClientMessageEx(playerid, COLOR_WHITE, "Error: No one was found with that MaskID.");
                }
            }
        }
    }
    else return SendClientMessageEx(playerid, COLOR_WHITE, "You are not authorized to use this command.");
    return 1;
}
Reply


Messages In This Thread
/checkmask doesn't work. - by DavidSparks - 08.08.2015, 19:49
Respuesta: /checkmask doesn't work. - by Tirael - 08.08.2015, 20:03
Re: Respuesta: /checkmask doesn't work. - by DavidSparks - 09.08.2015, 18:48
Respuesta: /checkmask doesn't work. - by Tirael - 10.08.2015, 01:23

Forum Jump:


Users browsing this thread: 1 Guest(s)