[Ajuda] format bugado??
#1

galera to com uma duvida
o seguinte
pawn Код:
CMD:setadmin (playerid,params[])
{
            new string[32], aname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
            new id; // Variavel que irб armazenar o id do jogador desejado!
            new nivel; // irб armazenar o nivel de administrador.
            new file[70], snd[MAX_PLAYER_NAME];
            GetPlayerName(playerid,aname, MAX_PLAYER_NAME);
            GetPlayerName(id, pname, MAX_PLAYER_NAME);
            if(sscanf(params,"ui",id,nivel))return SendClientMessage(playerid, -1, "[ERRO] Uso: /setadmin [playerid] [nivel]");
            if(nivel >= 6) return SendClientMessage(playerid,-1,"Niveis de 0 a 5");
            if(nivel == 0) {
            GetPlayerName(id, snd, sizeof snd);
            format(file, sizeof file, "Contas/%s.ini", snd);
            if(!DOF2_FileExists(file)) {
                DOF2_CreateFile(file); // caso o nome dele nгo esteja na pasta administradores.
            }
            DOF2_SetInt(file, "Admin", nivel); // irб setar na linha Admin o valor do nivel desejado.
            DOF2_SaveFile(); // salva e fecha o arquivo.
            pAdmin[id] = 0; // irб setar o nivel para ele!
            format(string, sizeof(string), "{FF0000}(INFO) {FFFFFF}O Admin Rcon %s (%d)(») {0000FF}Removeu admin do jogador: %s (%d)", aname,playerid,pname,id);
            SendClientMessageToAll(-1, string);
            SpawnPlayer(id);
            }else{
            SendClientMessage(playerid,-1,"ID Inexistente");
            }
            if(nivel >= 1){
            GetPlayerName(id, snd, sizeof snd);
            format(file, sizeof file, "Contas/%s.ini", snd);
            if(!DOF2_FileExists(file)) {
                DOF2_CreateFile(file); // caso o nome dele nгo esteja na pasta administradores.
            }
            DOF2_SetInt(file, "Admin", nivel); // irб setar na linha Admin o valor do nivel desejado.
            DOF2_SaveFile(); // salva e fecha o arquivo.
            pAdmin[id] = nivel; // irб setar o nivel para ele!
            format(string, sizeof(string), "{FF0000}(INFO) {191970}O Admin Rcon %s (%d)(») {0000FF}Promoveu para admin nv %d o jogador: %s (%d)", aname,playerid,nivel,pname,id);
            SendClientMessageToAll(-1, string);
            SpawnPlayer(id);
            }
            return true;
        }
terminei meu comando de setar admin soh que...... as mensagens por format estao erradas
tipo digito la /setadmin 0 5 ai em vez de aparecer tudo aparece soh ate o %s tipo (info) o admin....
e acaba aiii

eu fikei estudando isso mas n cheguei a uma conclusao porque....
pawn Код:
new string[32], aname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];//guardar string(format),nome do playerid e nome do id que sera enviado
            new id; // id que sera enviado
            new nivel; // armazena nivel de adm.
beleza depois seta tudo
pawn Код:
GetPlayerName(playerid,aname, MAX_PLAYER_NAME);//id do digitador do comando, nome do digitador do comando
            GetPlayerName(id, pname, MAX_PLAYER_NAME);//id do recebedor do cmd, nome do recebedor...
ae tipo
pawn Код:
format(string, sizeof(string), "{FF0000}(INFO) {FFFFFF}O Admin Rcon %s (%d)(») {0000FF}Removeu admin do jogador: %s (%d)", aname,playerid,pname,id);
            SendClientMessageToAll(-1, string);// coloquei tudo em ordem e nao deu..., aname,playerid,pname,id....................
Reply


Messages In This Thread
format bugado?? - by williamgato - 18.04.2014, 05:26
Re: format bugado?? - by Diogo123 - 18.04.2014, 06:27
Re: format bugado?? - by williamgato - 18.04.2014, 15:57
Re: format bugado?? - by caoraivoso3 - 18.04.2014, 16:03
Re: format bugado?? - by VeNuZ_ - 18.04.2014, 16:05
Re: format bugado?? - by williamgato - 18.04.2014, 16:11

Forum Jump:


Users browsing this thread: 1 Guest(s)