[Ajuda] comando de adm
#1

Gostaria de ajuda para criar um comando, simples, de dar admin. Nгo precisa nem salvar, mas apenas setar o player para admin.

Algo mais ou menos assim:
pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin[playerid/Parte-do-Nick]");
                return 1;
            }
            GetPlayerName(playerid, nome, sizeof nome);
            if(PlayerInfo[playerid][pAdmin] >= 4999)
            {
                       
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "Sem Autorizaзгo.");
            }
        }
        return 1;
    }
Nesse codigo ai nao tem a funзao pra escolher o id e nem de setar o id para
pawn Код:
[pAdmin] = 5000
Se alguem puder me ajudar com isso, vlw
Reply
#2

pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        tmp = strtok(cmdtext, idx);
        static id, nivel;
       
        if(!strlen(tmp))
            return SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin[playerid/Parte-do-Nick] [nivel]");
           
        id = strval(tmp);
           
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
            return SendClientMessage(playerid, COLOR_GRAD2, "USO: /daradmin[playerid/Parte-do-Nick] [nivel]");
       
        nivel = strval(tmp);
           
        GetPlayerName(playerid, nome, sizeof nome);
        if(PlayerInfo[playerid][pAdmin] >= 4999)
        {
            PlayerInfo[id][pAdmin] = nivel;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "Sem Autorizaзгo.");
        }
    }
    return 1;
}
Reply
#3

da error em:

pawn Код:
GetPlayerName(playerid, nome, sizeof nome);
nгo reconhece o "nome"
Reply
#4

no comeзo do comando
pawn Код:
new nome[MAX_PLAYER_NAME];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)