Jump to content
Sign in to follow this  
Koqs

Problema Register/Login

Recommended Posts

Salut,am facut un sistem register/login si nu am primit nicio eroare/warning si cand intru pe server nu imi apare sa ma inregistrez si nici loghez, baza de date este facuta pe localhost.Ceva idei?

Share this post


Link to post
Share on other sites

Probabill nu ai configurat bine in gamemode

Verifica daca ai asa la SQL =

  mysql_connect("localhost", "root", "numele bazei de date", ""), print("Server:localhost");

Edited by GhostyAdv

Share this post


Link to post
Share on other sites
Acum 43 minute, GhostyAdv a spus:

Probabill nu ai configurat bine in gamemode

Verifica daca ai asa la SQL =

  mysql_connect("localhost", "root", "numele bazei de date", ""), print("Server:localhost");

SQL = mysql_connect("localhost", "root", "gamemodebun_db", "");

Asa am incerc acum sa vad si revin cu un edit

Edit:Acceasi problema...Nu apare cand intru pe server sistemul de register sau login

Edited by Koqs

Share this post


Link to post
Share on other sites
3 hours ago, Koqs said:

SQL = mysql_connect("localhost", "root", "gamemodebun_db", "");

Asa am incerc acum sa vad si revin cu un edit

Edit:Acceasi problema...Nu apare cand intru pe server sistemul de register sau login

Ai verificat daca ai acceasi baza de date in phpmyadmin

Share this post


Link to post
Share on other sites
Acum 12 ore, GhostyAdv a spus:

Ai verificat daca ai acceasi baza de date in phpmyadmin

Da e acceasi

Share this post


Link to post
Share on other sites
La 12.07.2019 la 21:04, WiDuAlK a spus:

Dialogul e problema arata cum faci accesarea dialogurilor

 

 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
    switch(dialogid) {
        case DIALOG_REGISTER: {
            if(!response)
                return Kick(playerid);

            if(strlen(inputtext) < 6 || strlen(inputtext) > 32)
                return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Scrie o parola pentru a te putea inregistra!(Minim 6 caractere / maxim 32):", "Select", "Cancel");

            gQuery[0] = EOS;
            mysql_format(SQL, gQuery, sizeof(gQuery), "INSERT INTO `users ` (`Name`, `Password`) VALUES ('%s', '%s')",GetName(playerid), inputtext);
            mysql_tquery(SQL, gQuery, "insertAccount", "1", playerid);

            gString[0] = EOS;
            format(gString, sizeof(gString), "Parola ta contine %d caractere.", strlen (inputtext));
            SCM(playerid, -1,gString);

            format(PlayerInfo[playerid][pPassword], 32, inputtext);

            ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "Seteaza-ti adresa de email:", "Select", "Cancel");
        }
        case DIALOG_EMAIL: {
            if(!response)
                return Kick(playerid);

            if(strlen(inputtext) < 6 || strlen(inputtext) > 32)
            return ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", "Seteaza-ti adresa de email:", "Select", "Cancel");    

            gQuery[0] = EOS;
            mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `users` SET `Email`='%s' WHERE `ID`='%d'", inputtext, PlayerInfo[playerid][pSQLID]);
            mysql_tquery(SQL, gQuery, "", "", playerid);

            gString[0] = EOS;
            format(gString, sizeof(gString), "Email-ul tau este: %s.", inputtext);
            SCM(playerid, -1,gString);

            format(PlayerInfo[playerid][pEmail], 32, inputtext);    

            ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_MSGBOX, "Gender", "Seteaza-ti sexul:", "Masculin", "Feminin");    
        }
        case DIALOG_GENDER: {
            switch(response) {
                case 0: {
                    PlayerInfo[playerid][pGender] = 1;
                    SCM(playerid, -1, "Sex setat: Feminin.");
                }
                case 1: {
                    PlayerInfo[playerid][pGender] = 0;
                    SCM(playerid, -1, "Sex setat: Masculin.");
                }
            }

            gQuery[0] = EOS;
            mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `users` SET `Gender`='%d' WHERE `ID`='%d'", PlayerInfo[playerid][pGender], PlayerInfo[playerid][pSQLID]);
            mysql_tquery(SQL, gQuery, "", "", playerid);

            SpawnPlayer(playerid);
        }
        case DIALOG_LOGIN: {
            if(!response)
                return Kick(playerid);

             mysql_format(SQL, gQuery, sizeof(gQuery), "SELECT = FROM `users` WHERE `Name`='%s' AND `Password` = '%s' LIMIT 1", GetName(playerid), inputtext);
            mysql_tquery(SQL, gQuery, "onLogin", "1", playerid);
        }
    }
    return 1;
}

Share this post


Link to post
Share on other sites

Ok, verifica daca faci trimiterea la OnPlayerConnect la dialogul de register/login

Ti as recomanda sa adaugi inca o variabila la PlayerInfo -> StepRegister, in caz ca el a introdus odata parola si a iesit, sa revina la mail, si de acolo mai departe. Posteaza cum faci trimiterea la dialogul de register/login

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.