Jump to content

Problema dialog hider[REZOLVAT]


Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.