[ajuda] Comando em dialog
#1

Quero transformar esse comando em dialog pra abrir uma caixinha ao invйs de aparecer as escritas no chat do player:
pawn Код:
if(strcmp(cmd, "/orgs", true) == 0 || strcmp(cmd, "/organizacoes", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                    return 1;
                }
                SendClientMessage(playerid, COR_PM, "*** Policia Militar - 1");
                SendClientMessage(playerid, COR_SWAT, "*** SWAT - 2");
                SendClientMessage(playerid, COR_EXE, "*** Exercito - 3");
                SendClientMessage(playerid, COR_SAMU, "*** SAMU - 4");
                SendClientMessage(playerid, COR_AZTECAS, "*** Los Aztecas - 5");
                SendClientMessage(playerid, COR_TAL, "*** Taliban - 6");
                SendClientMessage(playerid, COR_PRE, "*** Prefeitura - 7");
                SendClientMessage(playerid, COR_HITMAN, "*** Hitmans - 8");
                SendClientMessage(playerid, COR_REP, "*** Reporter - 9");
                SendClientMessage(playerid, COR_TAXI, "*** Taxista - 10");
                SendClientMessage(playerid, COR_FBI, "*** FBI - 11");
                SendClientMessage(playerid, COR_COSA, "*** Mбfia Cosa Nostra - 12");
                SendClientMessage(playerid, COR_YAK, "*** Mбfia Yakuza - 13");
                SendClientMessage(playerid, COR_GRO, "*** Groove Street - 14");
                SendClientMessage(playerid, COR_AL, "*** Al'qaeda - 15");
                SendClientMessage(playerid, COR_PR, "*** Policia Rodoviaria - 16");
                SendClientMessage(playerid, COR_BALLAS, "*** Ballas - 17");
                SendClientMessage(playerid, COR_VAGOS, "*** Los Vagos - 18");
                SendClientMessage(playerid, 0xF6000000, "*** Comando Vermelho - 19");
                SendClientMessage(playerid, 0xCCFF99FF, "*** PCC - 20");
                SendClientMessage(playerid, 0x8B4513FF, "*** Drifters - 21");
                SendClientMessage(playerid, 0xFF9933AA, "*** Lowriders - 22");
            }
        }
        return 1;
    }
jб procurei uns tutoriais sу que to tendo problema por alguma coisa.
Reply
#2

Adapte
pawn Код:
//Topo
#define     DialogComandos      1243//ID do dialog

//OnPlayerCommandText
if(!strcmp(cmd, "/comandos", false))
{
    new stringcat[700];
    strcat(stringcat, "{00FBFF}/dm {00FF11}- {FFFFFF}Partidas de DeathMatch (si contra si).\n");
    strcat(stringcat, "{00FBFF}/drift {00FF11}- {FFFFFF}Partidas de drifts (derrapagens).\n");
    strcat(stringcat, "{00FBFF}/aerosf {00FF11}- {FFFFFF}Teleporte para o aeroporto de San Fierro\n");
    strcat(stringcat, "{00FBFF}/aerols {00FF11}- {FFFFFF}Teleporte para o aeroporto de Los Santos\n");
    strcat(stringcat, "{00FBFF}/aerolv {00FF11}- {FFFFFF}Teleporte para o aeroporto de Las Venturas\n");
    strcat(stringcat, "{00FBFF}/carmenu {00FF11}- {FFFFFF}Mostra o menu do veнculo atual\n");
    strcat(stringcat, "{00FBFF}/creditos {00FF11}- {FFFFFF}Vк os crйditos dos criadores e desenvolvedores do servidor\n");
    ShowPlayerDialog(playerid, DialogComandos, DIALOG_STYLE_MSGBOX, "Comandos...", stringcat, "Ok", " ");
    return 1;
}


//OnDialogResponse
if(dialogid == DialogComandos) return 1;
Reply
#3

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
Adapte
pawn Код:
//Topo
#define     DialogComandos      1243//ID do dialog

//OnPlayerCommandText
if(!strcmp(cmd, "/comandos", false))
{
    new stringcat[700];
    strcat(stringcat, "{00FBFF}/dm {00FF11}- {FFFFFF}Partidas de DeathMatch (si contra si).\n");
    strcat(stringcat, "{00FBFF}/drift {00FF11}- {FFFFFF}Partidas de drifts (derrapagens).\n");
    strcat(stringcat, "{00FBFF}/aerosf {00FF11}- {FFFFFF}Teleporte para o aeroporto de San Fierro\n");
    strcat(stringcat, "{00FBFF}/aerols {00FF11}- {FFFFFF}Teleporte para o aeroporto de Los Santos\n");
    strcat(stringcat, "{00FBFF}/aerolv {00FF11}- {FFFFFF}Teleporte para o aeroporto de Las Venturas\n");
    strcat(stringcat, "{00FBFF}/carmenu {00FF11}- {FFFFFF}Mostra o menu do veнculo atual\n");
    strcat(stringcat, "{00FBFF}/creditos {00FF11}- {FFFFFF}Vк os crйditos dos criadores e desenvolvedores do servidor\n");
    ShowPlayerDialog(playerid, DialogComandos, DIALOG_STYLE_MSGBOX, "Comandos...", stringcat, "Ok", " ");
    return 1;
}


//OnDialogResponse
if(dialogid == DialogComandos) return 1;
assim o gm jб veio com tudo adaptado pra caixas de dialog, alguns comandos como /gps sгo assim.
Reply
#4

pawn Код:
//Topo
#define  DialogORGS      1243

if(strcmp(cmd, "/orgs", true) == 0 || strcmp(cmd, "/organizacoes", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                    return 1;
                }
                SendClientMessage(playerid, COR_PM, "*** Policia Militar - 1");
                SendClientMessage(playerid, COR_SWAT, "*** SWAT - 2");
                SendClientMessage(playerid, COR_EXE, "*** Exercito - 3");
                SendClientMessage(playerid, COR_SAMU, "*** SAMU - 4");
                SendClientMessage(playerid, COR_AZTECAS, "*** Los Aztecas - 5");
                SendClientMessage(playerid, COR_TAL, "*** Taliban - 6");
                SendClientMessage(playerid, COR_PRE, "*** Prefeitura - 7");
                SendClientMessage(playerid, COR_HITMAN, "*** Hitmans - 8");
                SendClientMessage(playerid, COR_REP, "*** Reporter - 9");
                SendClientMessage(playerid, COR_TAXI, "*** Taxista - 10");
                SendClientMessage(playerid, COR_FBI, "*** FBI - 11");
                SendClientMessage(playerid, COR_COSA, "*** Mбfia Cosa Nostra - 12");
                SendClientMessage(playerid, COR_YAK, "*** Mбfia Yakuza - 13");
                SendClientMessage(playerid, COR_GRO, "*** Groove Street - 14");
                SendClientMessage(playerid, COR_AL, "*** Al'qaeda - 15");
                SendClientMessage(playerid, COR_PR, "*** Policia Rodoviaria - 16");
                SendClientMessage(playerid, COR_BALLAS, "*** Ballas - 17");
                SendClientMessage(playerid, COR_VAGOS, "*** Los Vagos - 18");
                SendClientMessage(playerid, 0xF6000000, "*** Comando Vermelho - 19");
                SendClientMessage(playerid, 0xCCFF99FF, "*** PCC - 20");
                SendClientMessage(playerid, 0x8B4513FF, "*** Drifters - 21");
                SendClientMessage(playerid, 0xFF9933AA, "*** Lowriders - 22");
                ShowPlayerDialog(playerid, DialogComandos, DIALOG_STYLE_MSGBOX, "Organizaзoes", stringcat, "Ok", "Fechar");
    return 1;
}


//OnDialogResponse
if(dialogid == DialogORGS) return 1;
Assim Ricardo
Reply
#5

Quote:
Originally Posted by WaGnerLiima
Посмотреть сообщение
pawn Код:
//Topo
#define  DialogORGS      1243

if(strcmp(cmd, "/orgs", true) == 0 || strcmp(cmd, "/organizacoes", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                    return 1;
                }
                SendClientMessage(playerid, COR_PM, "*** Policia Militar - 1");
                SendClientMessage(playerid, COR_SWAT, "*** SWAT - 2");
                SendClientMessage(playerid, COR_EXE, "*** Exercito - 3");
                SendClientMessage(playerid, COR_SAMU, "*** SAMU - 4");
                SendClientMessage(playerid, COR_AZTECAS, "*** Los Aztecas - 5");
                SendClientMessage(playerid, COR_TAL, "*** Taliban - 6");
                SendClientMessage(playerid, COR_PRE, "*** Prefeitura - 7");
                SendClientMessage(playerid, COR_HITMAN, "*** Hitmans - 8");
                SendClientMessage(playerid, COR_REP, "*** Reporter - 9");
                SendClientMessage(playerid, COR_TAXI, "*** Taxista - 10");
                SendClientMessage(playerid, COR_FBI, "*** FBI - 11");
                SendClientMessage(playerid, COR_COSA, "*** Mбfia Cosa Nostra - 12");
                SendClientMessage(playerid, COR_YAK, "*** Mбfia Yakuza - 13");
                SendClientMessage(playerid, COR_GRO, "*** Groove Street - 14");
                SendClientMessage(playerid, COR_AL, "*** Al'qaeda - 15");
                SendClientMessage(playerid, COR_PR, "*** Policia Rodoviaria - 16");
                SendClientMessage(playerid, COR_BALLAS, "*** Ballas - 17");
                SendClientMessage(playerid, COR_VAGOS, "*** Los Vagos - 18");
                SendClientMessage(playerid, 0xF6000000, "*** Comando Vermelho - 19");
                SendClientMessage(playerid, 0xCCFF99FF, "*** PCC - 20");
                SendClientMessage(playerid, 0x8B4513FF, "*** Drifters - 21");
                SendClientMessage(playerid, 0xFF9933AA, "*** Lowriders - 22");
                ShowPlayerDialog(playerid, DialogComandos, DIALOG_STYLE_MSGBOX, "Organizaзoes", stringcat, "Ok", "Fechar");
    return 1;
}


//OnDialogResponse
if(dialogid == DialogORGS) return 1;
Assim Ricardo
Nгo irб dar certo, pelo motivo de ter SendClientMessage e ShowPlayerDialog, ele irб mostrar em mensagem, neste caso vocк terб que utilizar strcat, ou format+strcat
Reply
#6

й mesmo,agora que percebii :X
Vou tentar fazer em Format+Strcat :P
Reply
#7

Ta ae...!


pawn Код:
if(strcmp(cmd, "/orgs", true) == 0 || strcmp(cmd, "/organizacoes", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] >= 1)
        {
            if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342)
            {
                 SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                 return 1;
            }
            new DialogKrayvhus[1500];
            format(string,sizeof(string), "{FF9000} 1 - {FFFFFF}Policia Militar\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 2 - {FFFFFF}SWAT\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 3 - {FFFFFF}Exercito\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 4 - {FFFFFF}SAMU\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 5 - {FFFFFF}Los Aztecas\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 6 - {FFFFFF}Taliban\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 7 - {FFFFFF}Prefeitura\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 8 - {FFFFFF}Hitmans\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 9 - {FFFFFF}Reporteres\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 10 - {FFFFFF}Taxistas\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 11 - {FFFFFF}FBI\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 12 - {FFFFFF}Mбfia Cosa Nostra\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 13 - {FFFFFF}Mбfia Yakuza\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 14 - {FFFFFF}Groove Street\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 15 - {FFFFFF}Al'qaeda\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 16 - {FFFFFF}Polнcia Rodoviбria\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 17 - {FFFFFF}Ballas\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 18 - {FFFFFF}Vagos\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 19 - {FFFFFF}Comando Vermelho\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 20 - {FFFFFF}PCC\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 21 - {FFFFFF}Drifters\n");
            strcat(DialogKrayvhus,string);
            format(string,sizeof(string), " 22 - {FFFFFF}Lowriders\n");
            strcat(DialogKrayvhus,string);
            ShowPlayerDialog(playerid, 27520, DIALOG_STYLE_MSGBOX, "{00ECEC}[ServerName] Organizaзхes ", DialogKrayvhus, "Fechar", "");
        }
        return true;
    }

Se tu usa InfoOrg, dб pra fazer um mais avanзado e bacana!

@Edit

Agora que vi a merda da data -.-"
Jб foi
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)