case CMSN: { if(response == 1) { if(!strcmp(inputtext, Info[playerid][pMSN])) SafeDialogEx(playerid, CPASS, DIALOG_STYLE_PASSWORD, "Cambiar Clave", "Por favor pon tu contraseсa nueva:", "Cambiar", "Atrбs" ); else ShowPlayerDialog(playerid, CMSN, DIALOG_STYLE_PASSWORD, "MAIL INCORRECTO", "Por favor ingresa tu mail correctamente:", "Cambiar", "Atrбs" ); } }
case CMSN:
{
if(response == 1)
{
if(strlen(inputtext) == 0)
{
if(Info[playerid][pMSN] == 1)
{
SafeDialogEx(playerid, CPASS, DIALOG_STYLE_PASSWORD, "Cambiar Clave", "Por favor pon tu contraseсa nueva:", "Cambiar", "Atrбs" );
}
else
{
ShowPlayerDialog(playerid, CMSN, DIALOG_STYLE_PASSWORD, "MAIL INCORRECTO", "Por favor ingresa tu mail correctamente:", "Cambiar", "Atrбs" );
}
}
}
}
stock ValidEmail(email[]) { new len=strlen(email); new cstate=0; new i; for(i=0;i<len;i++) { if ((cstate==0 || cstate==1) && (email[i]>='A' && email[i]<='Z') || (email[i]>='a' && email[i]<='z') || (email[i]=='.') || (email[i]=='-') || (email[i]=='_')) { } else { // Ok no A..Z,a..z,_,.,- if ((cstate==0) &&(email[i]=='@')) { // its an @ after the name, ok state=1; cstate=1; } else { // Its stuff which is not allowed return false; } } } if (cstate<1) return false; if (len<6) return false; // A toplevel domain has only 3 to 4 signs :-) if ((email[len-3]=='.') || (email[len-4]=='.') || (email[len-5]=='.')) return true; return false; }
Te repito lo mismo que ayer, tienes todo el sistema listo, lo que tienes que hacer que antes que empieze el tutorial te salga el dialogo, fijate bien, en el gm de zenon city termina preguntandote en que ciudad quieres vivir, ve ahi y fijate como esta compuesto, man no es nada de dificil, el sistema ya lo tienes todo listo! saludos.
|
CMD:cambiarclave(playerid, params[]) { if (gPlayerLogged{playerid}) { SafeDialogEx(playerid,CMSN,DIALOG_STYLE_INPUT,"Cambiar Clave","Ingresa tu mail para cambiar tu clave","Aceptar","Cancelar"); } else SendClientMessageEx(playerid, COLOR_GRAD1, "Debes de estar conectado para usar este comando."); return 1; } case CMSN: { if(response == 1) { if(strcmp(inputtext, Info[playerid][pMSN], true)==0) { SafeDialogEx(playerid, CPASS, DIALOG_STYLE_PASSWORD, "Cambiar Clave", "Por favor pon tu contraseсa nueva:", "Cambiar", "Atrбs" ); } else { ShowPlayerDialog(playerid, CMSN, DIALOG_STYLE_PASSWORD, "MAIL INCORRECTO", "Por favor ingresa tu mail correctamente:", "Cambiar", "Atrбs" ); } return 1; } } case CPASS: { if( strlen( inputtext ) >= 24 ) { SendClientMessageEx( playerid, COLOR_GRAD2, "No puedes cambiar una password a mбs de 24 carбcteres." ); } else { if( strlen( inputtext ) >= 1 ) { if(!response) { SendClientMessageEx(playerid, COLOR_WHITE, "No has cambiado tu contraseсa." ); } else { new String[ 84 ]; new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Password",udb_hash(inputtext)); INI_WriteString(File,"Key2",inputtext); INI_Close(File); format( String, sizeof( String ), "%s (IP: %s) a cambiado su contraseсa a %s.", GetPlayerNameEx(playerid), Info[playerid][pIP], inputtext); Log("logs/password.log", String); format( String, sizeof( String ), "Has cambiado tu contraseсa a: '%s'", inputtext ); SendClientMessageEx( playerid, COLOR_YELLOW, String ); } } else SendClientMessageEx( playerid, COLOR_WHITE, "No has cambiado tu contraseсa." ); } }
if(strcmp(inputtext, Info[playerid][pMSN]) == 0)
Si negas con !, significa que si strcmp devuelve un valor entero de 0 o menor
|