їComo implemento un nuevo Dialog_Style_Input?
#1

Lo que pasa es que me va todo bien, me dice que copie el texto y bien, luego me pide elegir color y cuando elijo alguna opcion se sale, їcomo lo arreglo?
Reply
#2

Deja los cуdigos
Reply
#3

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid == 222 )
	{
	    case 1:
	    {
	        if(response)
	        {
	            if(!strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{DAA520}Graffiti","{FFFFFF}Enter text graffiti.\n\nMaximum number of characters: {ff0000}18","Ok","Cancel");
	            if(strlen(inputtext) > 18) { SendClientMessage(playerid,0xFF6800FF,"Forbidden to write more than 18 characters."); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{DAA520}Graffiti","{FFFFFF}Enter text graffiti.\n\nMaximum number of characters: {ff0000}18","Ok","Cancel"); return 1; }
             	format(GraffitiText[playerid], 128, inputtext);
	            ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back");
			}
			else
			{
       			SendClientMessage(playerid,0xFF6800FF,"Drawing graffiti canceled.");
			    ResetVariables(playerid);
			}
		}
		case 2:
		{
		    if(response)
		    {
		    	switch(listitem)
		    	{
		        	case 0: ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"{DAA520}Enter color for graffiti","{ffffff}White\n{ff0000}Red\n{228B22}Green\n{FFFF00}Yellow\n{104E8B}Blue\n{009ACD}Lightblue\n{696969}Grey","Ok","Go back");
		        	case 1: ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"{DAA520}Enter HEX code for graffiti","{ffffff}Enter your HEX code for graffiti\n\nList of HEX codes - {DAA520}http://en.wikipedia.org/wiki/Help:Using_colours","Ok","Go back");
				}
			}
			else
			{
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{DAA520}Graffiti","{FFFFFF}Enter text graffiti.\n\nMaximum number of characters: {ff0000}18","Ok","Cancel");
			}
		}
		case 3:
		{
		    if(response)
		    {
				if(listitem == 0) { Color = "FFFFFF"; }
				else if(listitem == 1) { Color = "FF0000"; }
				else if(listitem == 2) { Color = "228B22"; }
				else if(listitem == 3) { Color = "FFFF00"; }
				else if(listitem == 4) { Color = "104E8B"; }
				else if(listitem == 5) { Color = "009ACD"; }
				else if(listitem == 6) { Color = "696969"; }
				format(GraffitiColor[playerid], 32, Color);
				ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"{DAA520}Select the font for graffiti","{ffffff}Font 1 {4682B4}[Urban Riot]\n{ffffff}Font 2 {4682B4}[Bombing]\n{ffffff}Font 3 {4682B4}[Impact]\n{ffffff}Font 4 {4682B4}[Los Santos]\n{ffffff}Font 5 {4682B4}[Gangland Style]","Ok","Go back");
			}
			else
			{
			    ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back");
			}
		}
		case 4:
		{
		    if(response)
		    {
		        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back");
		        if(strlen(inputtext) != 6) { SendClientMessage(playerid,0xFF6800FF,"You entered incorrect HEX code."); ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back"); return 1; }
                format(GraffitiColor[playerid], 32, inputtext);
                ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"{DAA520}Select the font for graffiti","{ffffff}Font 1 {4682B4}[Urban Riot]\n{ffffff}Font 2 {4682B4}[Bombing]\n{ffffff}Font 3 {4682B4}[Impact]\n{ffffff}Font 4 {4682B4}[Los Santos]\n{ffffff}Font 5 {4682B4}[Gangland Style]","Ok","Go back");
		    }
		    else
			{
			    ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back");
			}
		}
		case 5:
		{
		    if(response)
		    {
		        if(listitem == 0) { Font = "Urban Riot"; GraffitiSize[playerid] = 40; }
				else if(listitem == 1) { Font = "Bombing"; GraffitiSize[playerid] = 48; }
				else if(listitem == 2) { Font = "Impact"; GraffitiSize[playerid] = 48; }
				else if(listitem == 3) { Font = "Los Santos"; GraffitiSize[playerid] = 36; }
				else if(listitem == 4) { Font = "Gangland Style"; GraffitiSize[playerid] = 18; }
				format(GraffitiFont[playerid], 32, Font);
                ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"{DAA520}Action font","View font\nSelect the font","Ok","Go back");
		    }
		    else
			{
			    ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back");
			}
		}
		case 6:
		{
		    switch(listitem)
		    {
		        case 0:
				{
				    if(response)
				    {
				    	new Float:x, Float:y, Float:z, string[64];
				    	format(string, 128, "{%s}%s", GraffitiColor[playerid], GraffitiText[playerid]);
						GetPlayerPos(playerid, x,y,z);
				    	ShowFont[playerid] = CreateDynamicObject(19482, x+0.5, y, z, 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), playerid, 200);
						SetDynamicObjectMaterialText(ShowFont[playerid], 0, string, OBJECT_MATERIAL_SIZE_256x256, GraffitiFont[playerid], GraffitiSize[playerid], 0, 0xFFFFFFFF, 0, 1);
						SendClientMessage(playerid,-1,"Near you set text with the selected settings, which will be seen for five seconds.");
						SetPlayerPos(playerid, x+0.1,y,z);
						DeleteObjectTimer[playerid] = SetTimerEx("DeleteObject",5000,false,"i",playerid);
					}
					else
					{
						ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"{DAA520}Select the font for graffiti","{ffffff}Font 1 {4682B4}[Urban Riot]\n{ffffff}Font 2 {4682B4}[Bombing]\n{ffffff}Font 3 {4682B4}[Impact]\n{ffffff}Font 4 {4682B4}[Los Santos]\n{ffffff}Font 5 {4682B4}[Gangland Style]","Ok","Go back");
					}
				}
		        case 1: { CreateGraffiti(playerid); }
			}
		}
	}
	return 1;
}

LO QUE PASA ES QUE SOLAMENTE COLOCO EL TEXTO y luego sigue lo de el color, cuando selecciono alguno no sigue mas se sale.
Reply
#4

Fail
Reply
#5

No comprendo quй quieres hacer, ese script estб muy desornenado.
Reply
#6

PHP код:
   switch(dialogid == 222 )
     {
     } 
Asi no se usan "casos", como se puede decir en programaciуn, o bueno lo que yo llevo programando en java nunca he visto algo asi, tienes que hacer casos del dialogid: EJM

PHP код:
switch(dialogid)
{
     case 
222:
      {
               if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{DAA520}Graffiti","{FFFFFF}Enter text graffiti.\n\nMaximum number of characters: {ff0000}18","Ok","Cancel");
                if(
strlen(inputtext) > 18) { SendClientMessage(playerid,0xFF6800FF,"Forbidden to write more than 18 characters."); ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{DAA520}Graffiti","{FFFFFF}Enter text graffiti.\n\nMaximum number of characters: {ff0000}18","Ok","Cancel"); return 1; }
                 
format(GraffitiText[playerid], 128inputtext);
                
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back");
            }
            else
            {
                   
SendClientMessage(playerid,0xFF6800FF,"Drawing graffiti canceled.");
                
ResetVariables(playerid);
            }
       }

Y asi vas creando los showplayerdialog, segun lo necesites seleccionas el 222, donde lo vayas a necesitar y si queres crear varios dentro de un mismo dialog puedes usar una variable entera pasos[playerid] // pasos[MAX_PLAYERS], que indiquen cual dialog usar ejemplo:

PHP код:
                    if(pasos[playerid] == 0)
                    {
                         switch(
listitem)
                {
                    case 
0ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST,"{DAA520}Enter color for graffiti","{ffffff}White\n{ff0000}Red\n{228B22}Green\n{FFFF00}Yellow\n{104E8B}Blue\n{009ACD}Lightblue\n{696969}Grey","Ok","Go back");
                    case 
1ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"{DAA520}Enter HEX code for graffiti","{ffffff}Enter your HEX code for graffiti\n\nList of HEX codes - {DAA520}http://en.wikipedia.org/wiki/Help:Using_colours","Ok","Go back");
                }
            }
            else
            {
                
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{DAA520}Graffiti","{FFFFFF}Enter text graffiti.\n\nMaximum number of characters: {ff0000}18","Ok","Cancel");
            }
        }
        case 
3:
        {
            if(
response)
            {
                if(
listitem == 0) { Color "FFFFFF"; }
                else if(
listitem == 1) { Color "FF0000"; }
                else if(
listitem == 2) { Color "228B22"; }
                else if(
listitem == 3) { Color "FFFF00"; }
                else if(
listitem == 4) { Color "104E8B"; }
                else if(
listitem == 5) { Color "009ACD"; }
                else if(
listitem == 6) { Color "696969"; }
                
format(GraffitiColor[playerid], 32Color);
                
ShowPlayerDialog(playerid,5,DIALOG_STYLE_LIST,"{DAA520}Select the font for graffiti","{ffffff}Font 1 {4682B4}[Urban Riot]\n{ffffff}Font 2 {4682B4}[Bombing]\n{ffffff}Font 3 {4682B4}[Impact]\n{ffffff}Font 4 {4682B4}[Los Santos]\n{ffffff}Font 5 {4682B4}[Gangland Style]","Ok","Go back");
            }
            else
            {
                
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{DAA520}Selects how to display color","{ffffff}Enter from list\nEnter HEX code manually","Ok","Go back");
            }
          } 
PD: No modifique tu codigo mucho porque como dijo Malgayns, no se entiende que quieres hacer y el codigo esta desordenado.
Reply
#7

http://pastebin.com/DG5sDjvz

Ese es el FS que estoy implementando, pero cuando lo pongo en el gm se combina con otros Dialog, entonces їcomo podrнa ponerlo para que no se combinen con otros dialog?, ese FS no lo hice yo, y asн como esta en el pastebin es como el sujeto subiу el FS.
Reply
#8

Coloca los dialogs que tienes, te ayudo un poco a mezclar los, pero ten en cuenta mi comentario anterior para que aprendas tu solo a hacerlo.
Reply
#9

http://pastebin.com/j2Zi5x67

Ahн tienes unos cуdigos, їpodrнas ayudarme en serio? porque no tengo idea de como hacerle.
Reply
#10

Mira aqui te dejo, hice lo que pude si te manda errores mandamelos por privado, intenta leer todo para saber que es lo que se hizo, antes de decir cual es el problema. http://pastebin.com/UNvVP25P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)