[Ajuda] Admin e Funзao
#1

Ola Amigos, Eu Coloquei Um Sistema de funзao de admin no meu servidor, Tipo:

/daradmin [ID] [NIVEL] [FUNЗAO]

Admin: [tal] deu admin para [tal] com a funзao [tal]

Admin Online: [tal] Nivel: [tal] Funзao [tal]

Tipo isso acima ^^' ate ai tudo bem, agr tem um problema, toda vez que eu dou o admin, ao inves de ficar a funзao fica Um Ponto Tipo:

Admin: [tal] deu admin para [tal] com a funзao [.]' Como ageito Isso??
Cod Abaixo:

pawn Код:
if(strcmp(cmd, "/daradmin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 1340)
            {
                MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
                return 1;
            }
            AdmsVaga();
            if(VagaSobrando == 0)
            {
                MSGPLAYER(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                MSGPLAYER(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
                return 1;
            }
            new para1;
            new level;
            new funcao[56];
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                MSGPLAYER(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
                return 1;
            }
            level = strval(tmp);
            if(level == 0)
            {
                MSGPLAYER(playerid, COLOR_GRAD2, "USE: /limparadmin para limpar uma vaga");
                return 1;
            }
            GetPlayerName(para1, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(IsPlayerConnected(para1))
            {
                if(para1 != INVALID_PLAYER_ID)
                {
                    if(PlayerInfo[para1][pAdmin] >= 1342)
                    {
                        MSGPLAYER(playerid, COLOR_GRAD1, "Vocк nгo pode promover um Admin Dono/Scripter!");
                        format(string, sizeof(string), "O admin %s tentou te promover a nivel %d",sendername ,level);
                        MSGPLAYER(para1, COLOR_AZULBB, string);
                        return 1;
                    }
                    format(string, sizeof(string), "   Vocк foi promovido para level %d Com a Funзao %s - Por %s", level, funcao, sendername);
                    MSGPLAYER(para1, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "   Vocк promoveu o(a) %s Para o level %d Com a Funзao %s.", giveplayer,level,funcao);
                    MSGPLAYER(playerid, COLOR_LIGHTBLUE, string);
                    getdate(year, month, day);
                    gettime(hour,minute,second);
                    format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,
                    month, year, hour, minute, second);
                    PAdminsLog(string);
                    for(new i = 0; i < sizeof(AdmInfo); i++)
                    {
                        if(PlayerInfo[para1][pAdmin] > 0)
                        {
                            PlayerInfo[para1][pAdmin] = level;
                            break;
                        }
                        else if(AdmInfo[i][AdminVaga] == 0)
                        {
                            PlayerInfo[para1][pAdmin] = level;
                            AdmInfo[i][gMembro] = giveplayer;
                            AdmInfo[i][AdminVaga] = 1;
                            SaveAdm();
                            break;
                        }
                    }
                }
            }
        }
        return 1;
    }
Reply
#2

'funзгo' й referente ao comando ? se a funзгo й /daradmin, por que raios fazer o processador ter que executar essa leitura a mais numa variбvel que tambйm nгo faz muito sentido ?

Muito mais simples alterar diretamente na string...

Код:
"Vocк promoveu o(a) %s Para o level %d Com a Funзao /daradmin."
Reply
#3

Faзa igual como eu te mandei no sistema, crie um comando /daradmin e depois vocк cria um comando separado como /criarfuncao.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)