[Pregunta]: Sobre DIALOG_STYLE_LIST.
#1

Estaba haciendo un Dialog (DIALOG_STYLE_LIST) en el cual le quiero poner variables, pero me tira warnings a la hora de colocar las variables.

Ejemplo;

Код HTML:
         ShowPlayerDialog(playerid, D_DIALOG, DIALOG_STYLE_LIST, "Dialog", "%s\n%s\n%s", "Aceptar", "Cancelar", Info[giveplayerid][pVariable], Info[giveplayerid][pVariable], Info[giveplayerid][pVariable]);
TIP; cabe destacar que coloquй ahн las variables debido a que no se donde acomodarlas, por eso hago йste post.

Reply
#2

en ShowPlayerDialog no puedes poner mas parametros de los que hay, en este caso primero debes usar format

new string[100];
format(string, sizeof(string), "%s\n&s\n%s", Info[giveplayerid][pVariable], Info[giveplayerid][pVariable], Info[giveplayerid][pVariable]);

ShowPlayerDialog(playerid, D_DIALOG, DIALOG_STYLE_LIST, "Dialog", string, "Aceptar", "Cancelar");
Reply
#3

se utiliza format
saludos.


https://sampwiki.blast.hk/wiki/Format

Код:
new data[100];

format(data,sizeof(data), "%s\n%s\n%s",  Info[giveplayerid][pVariable], Info[giveplayerid][pVariable], Info[giveplayerid][pVariable] ):

ShowPlayerDialog(playerid, D_DIALOG, DIALOG_STYLE_LIST, "Dialog", data, "Aceptar", "Cancelar");
Reply
#4

Muchas gracias a los dos!
Reply
#5

Eso que estбs haciendo lo puedes hacer con este include:

https://sampforum.blast.hk/showthread.php?tid=475838

nada mбs lo pones y usas la funciуn Dialog_Show en vez de ShowPlayerDialog
Reply
#6

Quote:
Originally Posted by Zume
Посмотреть сообщение
Eso que estбs haciendo lo puedes hacer con este include:

https://sampforum.blast.hk/showthread.php?tid=475838

nada mбs lo pones y usas la funciуn Dialog_Show en vez de ShowPlayerDialog
sabes que el post tiene los links expirados , no? xD
saludos.
Reply
#7

uh no me fijй acб estб:

PHP код:
/*
    easyDialog.inc - Dialogs made easier!
    With this useful include, scripters can easily create
    dialogs and show them to players.
    This include will prevent dialog spoofing, ID collision
    and a lot more.
    Created by Emmet on Friday, January 24, 2014.
*/
#if !defined isnull
    #define isnull(%1) \
        
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
#define Dialog:%0(%1) \
    
forward dialog_%0(%1); public dialog_%0(%1)
#define Dialog_Show(%0,%1, \
    
Dialog_Open(%0#%1,
#define Dialog_Opened(%0) \
    
(CallRemoteFunction("Dialog_IsOpened""i", (%0)))
static
    
s_DialogName[MAX_PLAYERS][32 char],
    
s_DialogOpened[MAX_PLAYERS]
;
forward OnDialogPerformed(playeriddialog[], responsesuccess);
forward @dialog_format(); @dialog_format() {
    
format(""0"");
}
forward Dialog_IsOpened(playerid);
public 
Dialog_IsOpened(playerid)
{
    return (
s_DialogOpened[playerid]);
}
stock Dialog_Close(playerid)
{
    
s_DialogName[playerid]{0} = 0;
    
s_DialogOpened[playerid] = 0;
    return 
ShowPlayerDialog(playerid, -1DIALOG_STYLE_MSGBOX" "" "" """);
}
stock Dialog_Open(playerid, function[], stylecaption[], info[], button1[], button2[], {Float,_}:...)
{
    static
        
string[4096],
        
args
    
;
    if (!
strlen(info))
    {
        return 
0;
    }
    if ((
args numargs()) > 7)
    {
        while (--
args >= 7)
        {
            
#emit LCTRL 5
            #emit LOAD.alt args
            #emit SHL.C.alt 2
            #emit ADD.C 12
            #emit ADD
            #emit LOAD.I
            #emit PUSH.pri
        
}
        
#emit PUSH.S info
        #emit PUSH.C 4096
        #emit PUSH.C string
        #emit LOAD.S.pri 8
        #emit CONST.alt 16
        #emit SUB
        #emit PUSH.pri
        #emit SYSREQ.C format
        #emit LCTRL 5
        #emit SCTRL 4
        
ShowPlayerDialog(playerid32700stylecaptionstringbutton1button2);
    }
    else
    {
        
ShowPlayerDialog(playerid32700stylecaptioninfobutton1button2);
    }
    
s_DialogOpened[playerid] = 1;
    
strpack(s_DialogName[playerid], function, 32 char);
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    
/*if(dialogid != GetPVarInt(playerid, "playerDialogID"))
    {
        KickPlayer(playerid,"el sistema","Dialog Xploits");
        return 1;
    }*/
    
static
        
s_Public cellmax;
    if (
s_Public == cellmax)
    {
        
s_Public funcidx("OnDialogPerformed");
    }
    
// Sanitize inputs.
    
for (new 0strlen(inputtext); l++)
    {
        if (
inputtext[i] == '%')
        {
            
inputtext[i] = '#';
        }
    }
    if (
dialogid == 32700 && strlen(s_DialogName[playerid]) > 0)
    {
        new
            
string[40];
        
strcat(string"dialog_");
        
strcat(strings_DialogName[playerid]);
        
Dialog_Close(playerid);
        if ((
s_Public == -1) || (CallLocalFunction("OnDialogPerformed""dsdd"playeridstring[7], responsefuncidx(string) != -1)))
        {
             
CallLocalFunction(string"ddds"playeridresponselistitem, (!inputtext[0]) ? ("\1") : (inputtext));
        }
    }
    
#if defined DR_OnDialogResponse
        
return DR_OnDialogResponse(playeriddialogidresponselistiteminputtext);
    
#else
        
return 0;
    
#endif
}
#if defined _ALS_OnDialogResponse
    #undef OnDialogResponse
#else
    #define _ALS_OnDialogResponse
#endif
#define OnDialogResponse DR_OnDialogResponse
#if defined DR_OnDialogResponse
    
forward DR_OnDialogResponse(playeriddialogidresponselistiteminputtext[]);
#endif 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)