SA-MP Forums Archive
[Ajuda] Dialog nгo funciona - 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: [Ajuda] Dialog nгo funciona (/showthread.php?tid=354998)



[Ajuda] Dialog nгo funciona - LordShadow - 28.06.2012

Pessoal, criei uma dialog de tele mais nao funfa. Eu acho que estб faltando algo veja comando e dialog

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerPos(playerid, 1441.3447265625, -81.607513427734, 19.172569274902);
                    new string[64],
                    name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string, sizeof(string), "%s Foi para Arena X1! digite /teles para ir!", name);
                    SendClientMessageToAll(AZUL_CLARO, string);
                    GivePlayerWeapon(playerid, 24, 500);
                    GivePlayerWeapon(playerid, 25, 500);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerHealth(playerid, 100.0);
                    SetPlayerInterior(playerid,0);
                }
                case 1:
                {
                    SetPlayerPos(playerid, 307.9531, 2543.4531, 20.3984);
                    new string[64],
                    name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string, sizeof(string), "%s Foi para o Drop Tubo! digite /teles para ir!", name);
                    SendClientMessageToAll(AZUL_CLARO, string);
                }
            }
            }
    }
    }
    return 1;
}
pawn Code:
if(strcmp(cmdtext,"/teles", true) == 0)
    {
        ShowPlayerDialog(playerid,DIALOG_TELE,DIALOG_STYLE_LIST ,"Onde deseja ir?","Arenax1\nDrop Tubo","Ir","Cancelar");
        return 1;
    }



Re: [Ajuda] Dialog nгo funciona - .FuneraL. - 28.06.2012

@Edit - Merda, Odeio esse Lag do Forum SAMP, Desculpem o DoublePost, o de Baixo Estб Correto.


Re: [Ajuda] Dialog nгo funciona - .FuneraL. - 28.06.2012

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
            {
OMFG, Troque esse Inicio por este:

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
     if(dialogid == DIALOGTELE)
     {    
          if(response)
          {
                switch(listitem)
                {



Re: [Ajuda] Dialog nгo funciona - LordShadow - 28.06.2012

/\ Double Post

@TOPIC
pawn Code:
error 010: invalid function or declaration
No return 1;

Veja como ficou:

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
         switch(listitem)
         {
                case 0:
                {
                    SetPlayerPos(playerid, 1441.3447265625, -81.607513427734, 19.172569274902);
                    new string[64],
                    name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string, sizeof(string), "%s Foi para Arena X1! digite /teles para ir!", name);
                    SendClientMessageToAll(AZUL_CLARO, string);
                    GivePlayerWeapon(playerid, 24, 500);
                    GivePlayerWeapon(playerid, 25, 500);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerHealth(playerid, 100.0);
                    SetPlayerInterior(playerid,0);
                }
                case 1:
                {
                    SetPlayerPos(playerid, 307.9531, 2543.4531, 20.3984);
                    new string[64],
                    name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string, sizeof(string), "%s Foi para o Drop Tubo! digite /teles para ir!", name);
                    SendClientMessageToAll(AZUL_CLARO, string);
                }
            }
    }
    }
    return 1;
}
@EDIT - DESCULPE , ESQUECI DE DELETAR UMA DAS CHAVES FECHADA (TINHA A MAIS) ARRUMEI O ERRO BLZ. VLW AI + REP



Re: [Ajuda] Dialog nгo funciona - .FuneraL. - 28.06.2012

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOGTELE)
    {    
         if(response)
         {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerPos(playerid, 1441.3447265625, -81.607513427734, 19.172569274902);
                    new string[64],
                    name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string, sizeof(string), "%s Foi para Arena X1! digite /teles para ir!", name);
                    SendClientMessageToAll(AZUL_CLARO, string);
                    GivePlayerWeapon(playerid, 24, 500);
                    GivePlayerWeapon(playerid, 25, 500);
                    SetPlayerArmour(playerid, 100.0);
                    SetPlayerHealth(playerid, 100.0);
                    SetPlayerInterior(playerid,0);
                }
                case 1:
                {
                    SetPlayerPos(playerid, 307.9531, 2543.4531, 20.3984);
                    new string[64],
                    name[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, name, sizeof(name));
                    format(string, sizeof(string), "%s Foi para o Drop Tubo! digite /teles para ir!", name);
                    SendClientMessageToAll(AZUL_CLARO, string);
                }
            }
    }
    }
    return 1;
}
Assim

@OFF

Double-Post foi por Causa do Lag do Forum SA-MP u.u



Re: [Ajuda] Dialog nгo funciona - LordShadow - 28.06.2012

Agora sim, arrumou atй o ID do dialog ^^ Valeu!