SA-MP Forums Archive
[Pedido] Me ajudem com Um Comando De Trocar nick - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Me ajudem com Um Comando De Trocar nick (/showthread.php?tid=510692)



Me ajudem com Um Comando De Trocar nick - ElGringo - 02.05.2014

Pow Galera Me Falem Como eu posso , tipo liberar o player para ele dar o comando /trocarnick e o adm /liberarnick id.


Re: Me ajudem com Um Comando De Trocar nick - Gii - 02.05.2014

pawn Код:
new bool:podeMudarNick[MAX_PLAYERS];

public OnPlayerConnect(playerid) {

    podeMudarNick[playerid] = false;
    return 1;
}

CMD:liberarnick(playerid, params[]) {

    if (!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid, -1, "Vocк nгo й administrador!");
       
    if ( isnull(params))
        return SendClientMessage(playerid, -1, "Use /liberarnick [id]!");

    static id;
   
    id = strval(params);
   
    if ( !IsPlayerConnected(id))
        return SendClientMessage(playerid, -1, "Jogador offline!");

    static
        nome[24],
        str[128]
    ;

    if ( podeMudarNick[id] == false ) {
   
        podeMudarNick[id] = true;
       
        GetPlayerName(playerid, nome, 24);
        format (str, 128, "O administrador %s autorizou vocк a mudar seu nick!", nome);
        SendClientMessage(id, -1, str);
       
        GetPlayerName(id, nome, 24);
        format (str, 128, "Vocк autorizou %s a mudar seu nick!", nome);
        SendClientMessage(playerid, -1, str);
   
    }
    else {
   
        podeMudarNick[id] = false;

        GetPlayerName(playerid, nome, 24);
        format (str, 128, "O administrador %s desautorizou vocк a mudar seu nick!", nome);
        SendClientMessage(id, -1, str);

        GetPlayerName(id, nome, 24);
        format (str, 128, "Vocк desautorizou %s a mudar seu nick!", nome);
        SendClientMessage(playerid, -1, str);
   
    }

    return 1;
}

CMD:mudarnick(playerid, params[]) {

    if ( podeMudarNick[playerid] == false )
        return SendClientMessage(playerid, -1, "Vocк nгo pode mudar seu nick!");
       
    if (strlen(params) < 3 || strlen(params) > 24)
        return SendClientMessage(playerid, -1, "Use /mudarnick [novo nome]!");
       
    static
        nome_antigo[24],
        str[128]
    ;
   
    GetPlayerName(playerid, nome_antigo, 24);
       
    SetPlayerName(playerid, params);
    podeMudarNick[playerid] = false;
   
    format (str, 128, "Vocк mudou seu nome para %s!", params);
    SendClientMessage(playerid, -1, str);
   
    format (str, 128, "%s mudou seu nick para %s", nome_antigo, params);
    SendClientMessageToAll(-1, str);

    return 1;
}
Nгo compilei muito menos testei.


Re: Me ajudem com Um Comando De Trocar nick - ElGringo - 02.05.2014

cara sou novato , me diga onde coloco este cod por favor


Re: Me ajudem com Um Comando De Trocar nick - ANNIHILATION - 02.05.2014

se seu gm for de trucking coloque em > pawno/include/PPC_PlayerCommand [ ADICIONE NA ULTIMA LINHA OS 2 CMDS] | Ja se o seu gm for RPG Entre Outros Coloque no Seu GameMod [GM].
Se Voce Nao Sabe Abrir | PAWNO/PAWNO.EXE | NO PAWNO VAI EM FILE LA EM CIMA | OPEN | VA ATE A PASTA GAMEMODS DO SEU GM | E CLIQUE NO DEVIDO GAMEMOD QUE ESTA NO SERVIDOR. | APOS ABERTO COLOQUE LA EM BAIXO ABAIXE A BARRINHA DE SCROLL TUDO PRA BAIXO E DE UM ENTER E COLE LA E APOS ISSO COMPILE. SE DER ERROS AVISE-NOS AQUI EM BAIXO.