Jump to content

Recommended Posts

Posted (edited)

Am facu si eu un sistem de pin pe dialog si la testare imi da kick pe motivul dialog hider 

function OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
	new string[500];
	if(dialogID[playerid] == -1) return AdmBot(playerid, "Dialog Hider");

	dialogID[playerid] = -1;
	
	new bool:anuntat = false;
    if(!isnull(inputtext))
    {
        for(new _pos; inputtext[_pos] > 0; _pos++){
            if(inputtext[_pos] == '%')
            {
                inputtext[_pos] = '#';
                if(!anuntat) {
                    anuntat = true;
                }
            }
        }
    }
    switch(dialogid) {
		case DIALOG_SETPIN: {
			if(!response) return 1;
			if(!IsNumeric(inputtext)) return SCM(playerid, COLOR_LIGHTGREEN3, "Pinul trebuie sa contina doar numere!");
			if(strlen(inputtext) > 4) return SCM(playerid, COLOR_LIGHTGREEN3, "Pinul trebuie sa fie format din 4 numere!");
			new pin = strval(inputtext);
			playerVariables[playerid][pPin] = pin;
			playerVariables[playerid][pPinLogged] = 1;
			format(string, sizeof(string), "Pinul tau este %d", pin);
			SCM(playerid, COLOR_ORANGE, string);
			new query[180];
			mysql_query(SQL, query);
		}
		case DIALOG_PIN: {
			if(!response) return 1;
			new pin = strval(inputtext);
			if(playerVariables[playerid][pPin] != pin) return SCM(playerid, COLOR_RED, "Pin Invalid!");
			playerVariables[playerid][pPinLogged] = 1;
			SCM(playerid, COLOR_YELLOW, "Te-ai logat cu succes cu pin-ul setat de tine!");
		}
		case DIALOG_CHANGEPIN: {
			if(!response) return 1;
			new pin = strval(inputtext);
			if(playerVariables[playerid][pPin] != pin) return SCM(playerid, COLOR_RED, "Pin Invalid!");
			ShowPlayerDialog(playerid, DIALOG_CHANGEPIN+1, DIALOG_STYLE_INPUT, "New Pin", "Seteaza-ti noul tau pin!", "Ok", "Exit");		
		}
		case DIALOG_CHANGEPIN+1: {
			if(!response) return 1;
			new pin = strval(inputtext);
			playerVariables[playerid][pPin] = pin;
			format(string, sizeof(string), "Noul tau pin este %d", pin);
			SCM(playerid, COLOR_ORANGE, string);
			new query[180];
			mysql_query(SQL, query);
		}	
	}
Edited by Alexandru Alex
Va rog frumos sa ma ajutati

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.