[Ajuda] Apenas determinados nick podem usar algum comando
#1

Ola, qual funзгo devo usar para restringir um comando para apenas alguns determinados nick poderem usar esse comando.

Esse й o "tal" comando
pawn Код:
if(strcmp(cmd, "/cnn", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                new length = strlen(cmdtext);
                while ((idx < length) && (cmdtext[idx] <= ' '))
                {
                    idx++;
                }
                new offset = idx;
                new result[64];
                while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                {
                    result[idx - offset] = cmdtext[idx];
                    idx++;
                }
                result[idx - offset] = EOS;
                if(!strlen(result))
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "USE: /cnn [cnn formato ~n~=NovaLinha ~r~=Vermelho ~g~=Verde ~b~=Azul ~w~=Branco ~y~=Amarelo ~l~=Preto]");
                    return 1;
                }
                else
                {
                    format(string, sizeof(string), "~b~%s: ~w~%s",sendername,result);
                }
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        GameTextForPlayer(i, string, 5000, 3);
                    }
                }
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo estб autorizado a usar este comando!");
                return 1;
            }
        }
        return 1;
    }
Reply


Messages In This Thread
Apenas determinados nick podem usar algum comando - by TheHiredKillers - 06.10.2015, 17:07
Re: Apenas determinados nick podem usar algum comando - by garotin - 06.10.2015, 17:11
Re: Apenas determinados nick podem usar algum comando - by TheHiredKillers - 06.10.2015, 17:20
Re: Apenas determinados nick podem usar algum comando - by rjjj - 07.10.2015, 15:07
Re: Apenas determinados nick podem usar algum comando - by RogerCosta - 07.10.2015, 15:35

Forum Jump:


Users browsing this thread: 1 Guest(s)