SA-MP Forums Archive
No pasa nada al introducir la edad en el dialog - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: No pasa nada al introducir la edad en el dialog (/showthread.php?tid=590311)



No pasa nada al introducir la edad en el dialog - Ghost112397 - 27.09.2015

Buenas, fui a probar el sistema de registro que habнa hecho, pero resulta que al introducir la edad del personaje, no es llamado lo que estб dentro del dialog, no sй si me entienden, les dejarй el cуdigo para que vean, desde ya muchas gracias.
PHP код:
case DIALOG_EDAD:
           {
               if(
IsNumeric(inputtext))
               {
                if(
strlen(inputtext) > 18 || strlen(inputtext) < 80)
                {
                                
// DE ACБ PARA ABAJO NO FUNCIONAN LAS FUNCIONES.
                    
Info[playerid][pEdad] = strval(inputtext);
                    
Registrado[playerid] = true;
                    
TogglePlayerControllable(playerid,false);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][0]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][1]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][2]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][3]);
                    
SetTimerEx("descongelar",3000,false,"i",playerid);
                    
SetTimerEx("escondertextdrawconfig",3000,false,"i",playerid);
                    
RegistrarJugador(playerid);
                    
SpawnPlayer(playerid);
                }
                else
                {
                    
ShowPlayerDialog(playerid,DIALOG_EDAD,DIALOG_STYLE_INPUT,"Introduce la edad que tendrб tu personaje","El limite de edad permitido es entre 18 y 80","Aceptar","");
                }
            }
            else
            {
                
ShowPlayerDialog(playerid,DIALOG_EDAD,DIALOG_STYLE_INPUT,"Introduce la edad que tendrб tu personaje","El limite de edad permitido es entre 18 y 80","Aceptar","");
            }
        } 



Re: No pasa nada al introducir la edad en el dialog - Unrea1 - 27.09.2015

Usa la condiciуn:

Код:
if(response)
! es para cuando presiona cancelar el usuario, osea:

Код:
if(response) // Presionу aceptar.

if(!response) // Presionу cancelar



Respuesta: No pasa nada al introducir la edad en el dialog - Zume - 27.09.2015

cambia strlen por strval

strlen = length = largo = comprueba la longitud de un string
strval = value = valor = pasa el string a un valor numerico


Respuesta: No pasa nada al introducir la edad en el dialog - ErickPuga234 - 27.09.2015

Quote:
Originally Posted by Ghost112397
Посмотреть сообщение
Buenas, fui a probar el sistema de registro que habнa hecho, pero resulta que al introducir la edad del personaje, no es llamado lo que estб dentro del dialog, no sй si me entienden, les dejarй el cуdigo para que vean, desde ya muchas gracias.
PHP код:
case DIALOG_EDAD:
           {
               if(
IsNumeric(inputtext))
               {
                if(
strlen(inputtext) > 18 || strlen(inputtext) < 80)
                {
                                
// DE ACБ PARA ABAJO NO FUNCIONAN LAS FUNCIONES.
                    
Info[playerid][pEdad] = strval(inputtext);
                    
Registrado[playerid] = true;
                    
TogglePlayerControllable(playerid,false);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][0]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][1]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][2]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][3]);
                    
SetTimerEx("descongelar",3000,false,"i",playerid);
                    
SetTimerEx("escondertextdrawconfig",3000,false,"i",playerid);
                    
RegistrarJugador(playerid);
                    
SpawnPlayer(playerid);
                }
                else
                {
                    
ShowPlayerDialog(playerid,DIALOG_EDAD,DIALOG_STYLE_INPUT,"Introduce la edad que tendrб tu personaje","El limite de edad permitido es entre 18 y 80","Aceptar","");
                }
            }
            else
            {
                
ShowPlayerDialog(playerid,DIALOG_EDAD,DIALOG_STYLE_INPUT,"Introduce la edad que tendrб tu personaje","El limite de edad permitido es entre 18 y 80","Aceptar","");
            }
        } 
PHP код:
case DIALOG_EDAD:
           {
                new 
edad strval(inputtext);
                if(
edad 18 || edad 80)
                {
                    
Info[playerid][pEdad] = edad;
                    
Registrado[playerid] = true;
                    
TogglePlayerControllable(playerid,false);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][0]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][1]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][2]);
                    
PlayerTextDrawShow(playerid,ConfigCuenta[playerid][3]);
                    
SetTimerEx("descongelar",3000,false,"i",playerid);
                    
SetTimerEx("escondertextdrawconfig",3000,false,"i",playerid);
                    
RegistrarJugador(playerid);
                    
SpawnPlayer(playerid);
                }
                else
                {
                    
ShowPlayerDialog(playerid,DIALOG_EDAD,DIALOG_STYLE_INPUT,"Introduce la edad que tendrб tu personaje","El limite de edad permitido es entre 18 y 80","Aceptar","");
                }
            }
            else
            {
                
ShowPlayerDialog(playerid,DIALOG_EDAD,DIALOG_STYLE_INPUT,"Introduce la edad que tendrб tu personaje","El limite de edad permitido es entre 18 y 80","Aceptar","");
            }
        } 



Respuesta: No pasa nada al introducir la edad en el dialog - Ghost112397 - 28.09.2015

Ya hice lo que me dijeron pero sigue sin funcionar el cуdigo que estб dentro del dialog. їAlguna ayuda? Por favor :c