[FilterScript] [cCN] Change Color Nick by cLerIsoN
#10

Quote:
Originally Posted by Jason`
Посмотреть сообщение
Nгo querendo desvalorizar o seu trabalho, mas vocк poderia melhorar muito esse sistema. Tornб-lo mais dinвmico (nгo sei se й a expressгo mais adequada).


Veja, tornei seu sistema bem mais fбcil de se editar adicionando ou removendo cores.

pawn Код:
#include <a_samp>



enum E_COLOR_INFO {
    colorName[32],
    colorHex
}

const DIALOG_COLOR  = 1000;



new colorInfo[][E_COLOR_INFO] = {
    {"Vermelho", 0xff0000ff},
    {"Verde", 0x32cd32ff},
    {"Azul", 0x1e90ffff},
    {"Amarelo", 0xf6f600ff},
    {"Laranja", 0xffa500ff},
    {"Rosa", 0xff00ffff},
    {"Cinza", 0x696969ff},
    {"Branco", 0xffffffff}
};



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {

    if(dialogid == DIALOG_COLOR) {

        if(response) {

            new string[64];

            format(string, sizeof string, ">> Vocк alterou a cor de seu nick para %s", colorInfo[listitem][colorName]);
            SendClientMessage(playerid, colorInfo[listitem][colorHex], string);

            SetPlayerColor(playerid, colorInfo[listitem][colorHex]);
        }
    }
    return true;
}



public OnPlayerCommandText(playerid, cmdtext[]) {

    if(!strcmp("cornick", cmdtext[1], true)) {
       
        new
            string[64],
            buffer[11 + ((sizeof colorInfo) * 32)];

        for(new i; i < sizeof colorInfo; ++i) {
            format(string, sizeof string, "{%x}%s\n", (colorInfo[i][colorHex] >>> 8), colorInfo[i][colorName]);
            strcat(buffer, string);
        }
        ShowPlayerDialog(playerid, DIALOG_COLOR, DIALOG_STYLE_LIST, "{ffffff}Alterar cor", buffer, "Alterar", "Cancelar");
        return true;
    }
    return false;
}
Caalma, o garoto mal estб aprendendo o portuguкs e vocк estб empurrando as figuras de linguagem ?



Bom trabalho, mas pйssima escolha do projeto.

++Rep como incentivo
Reply


Messages In This Thread
[cCN] Change Color Nick by cLerIsoN - by clerISoN - 31.05.2013, 19:20
Re: [cCN] Change Color Nick by cLerIsoN - by AlucardSnow - 31.05.2013, 19:35
Re: [cCN] Change Color Nick by cLerIsoN - by clerISoN - 31.05.2013, 19:39
Re: [cCN] Change Color Nick by cLerIsoN - by Jason` - 31.05.2013, 19:46
Re: [cCN] Change Color Nick by cLerIsoN - by clerISoN - 31.05.2013, 19:51
Re: [cCN] Change Color Nick by cLerIsoN - by Naja - 31.05.2013, 19:57
Re: [cCN] Change Color Nick by cLerIsoN - by Delete_ - 31.05.2013, 21:10
Re: [cCN] Change Color Nick by cLerIsoN - by lucaspilar - 01.06.2013, 00:24
Re: [cCN] Change Color Nick by cLerIsoN - by vitorvlv - 01.06.2013, 05:22
Re: [cCN] Change Color Nick by cLerIsoN - by zSuYaNw - 01.06.2013, 09:43

Forum Jump:


Users browsing this thread: 3 Guest(s)