Jump to content

Problema pin


Alysson

Recommended Posts

Salut. Am facut un sistem de pin si nu se introduce in baza de date. 
Aici aveti code-ul.

case DIALOG_SETPIN: {
            if(!response) return 1;
            if(!IsNumeric(inputtext)) return SCM(playerid, COLOR_LIGHTBLUE, "Codul tau pin trebuie sa fie format numai din cifre.");
            if(strlen(inputtext) < 4 || strlen(inputtext) > 4) return SCM(playerid, COLOR_LIGHTBLUE, "Codul tau pin trebuie sa fie format din 4 cifre.");
            new pin = strval(inputtext);
            PlayerInfo[playerid][pPin] = pin;
            PlayerInfo[playerid][pPinLogged] = 1;
            format(string, sizeof(string), "Codul tau pin este : %d", pin);
            SCM(playerid, COLOR_LIGHTBLUE, string);
            new query[100];
            format(query, sizeof(query), "UPDATE `users` SET `Pin`=`%d` WHERE `ID`=`%d`", pin, PlayerInfo[playerid][pSQLID]);
            mysql_query(SQL, query);

        }
        case DIALOG_LOGINPIN: {
            if(!response) return 1;
            new pin = strval(inputtext);
            if(PlayerInfo[playerid][pPin] != pin) return SCM(playerid, COLOR_RED, "Cod pin invalid.");
            PlayerInfo[playerid][pPinLogged] = 1;
            SCM(playerid, COLOR_GREEN, "Ai introdus codul pin cu succes.");
        }
        case DIALOG_CHANGEPIN: {
            if(!response) return 1;
            new pin = strval(inputtext);
            if(PlayerInfo[playerid][pPin] != pin) return SCM(playerid, COLOR_RED, "Cod pin invalid.");
            ShowPlayerDialog(playerid, DIALOG_CHANGEPIN+1, DIALOG_STYLE_INPUT, "Changepin", "Scrie mai jos noul tau cod pin.", "Ok", "Cancel");
        }
        case DIALOG_CHANGEPIN+1: {
            if(!response) return 1;
            if(strlen(inputtext) < 4 || strlen(inputtext) > 4) return SCM(playerid, COLOR_LIGHTBLUE, "Codul pin trebuie sa fie format din 4 cifre.");
            if(!IsNumeric(inputtext)) return SCM(playerid, COLOR_LIGHTBLUE, "Codul pin trebuie sa contina doar cifre.");
            new pin = strval(inputtext);
            PlayerInfo[playerid][pPin] = pin;
            format(string, sizeof(string), "Noul tau cod pin este: %d", PlayerInfo[playerid][pPin]);
            SCM(playerid, COLOR_LIGHTBLUE, string);
            new query[100];
            format(query, sizeof(query), "UPDATE `users` SET `Pin`=`%d` WHERE `ID`=`%d`", pin, PlayerInfo[playerid][pSQLID]);
            mysql_query(SQL, query);
        }

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.