Jump to content

Question

Posted (edited)

Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
    if(!response)
        return Kick(playerid);
        
    if(strlen(inputtext) < 8 || strlen(inputtext) > 64)
        return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Type your desired password below:\n{AFAFAF}Numarul de caractere trebuie sa fie format din 8 - 64.", "Register", "Cancel");

    format(PlayerInfo[playerid][pName], 24, GetPlayerNameEx(playerid));
    format(PlayerInfo[playerid][pPassword], 128, inputtext);

    gQuery[0] = (EOS);
    mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime(), GetDateTime());
    
    inline CheckSQLID()
    {
        PlayerInfo[playerid][pSQLID] = cache_insert_id();
        printf("New account: %s (%d).", GetPlayerNameEx(playerid), playerid);
        return true;
    }
    
    mysql_pquery_inline(SQL, gQuery, using inline CheckSQLID, "");
    Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-mail", "Scrie mai jos adresa ta de e-mail:", "Select", "Cancel");
    return true;
}

Nu am erori, dar dupe ce ma inregistrez si ma duc in baza de date nu se salveaza nimic...

habar nu am de ce

Daca ma poate ajuta cineva intr-o ora de preferat as fii recunoscator..

 

Edit: am pus in alta baza gen acolo la mysql_connect si dupa a mers.. nush ce are

Edited by NuamNume

24 answers to this question

Recommended Posts

  • 0
Posted
Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
    if(!response)
        return Kick(playerid);
        
    if(strlen(inputtext) < 8 || strlen(inputtext) > 64)
        return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Type your desired password below:\n{AFAFAF}Numarul de caractere trebuie sa fie format din 8 - 64.", "Register", "Cancel");

    format(PlayerInfo[playerid][pName], 24, GetPlayerNameEx(playerid));
    format(PlayerInfo[playerid][pPassword], 128, inputtext);

    gQuery[0] = (EOS);
    mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime(), GetDateTime());
    
    inline CheckSQLID()
    {
        PlayerInfo[playerid][pSQLID] = cache_insert_id();
        printf("New account: %s (%d).", GetPlayerNameEx(playerid), playerid);
    }
    
    mysql_pquery_inline(SQL, gQuery, using inline CheckSQLID, "");
    Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-mail", "Scrie mai jos adresa ta de e-mail:", "Select", "Cancel");
    return true;
}

Incearca asta.

  • 0
Posted (edited)
Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
{
    if(!response)
        return Kick(playerid);
        
    if(strlen(inputtext) < 8 || strlen(inputtext) > 64)
        return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Type your desired password below:\n{AFAFAF}Numarul de caractere trebuie sa fie format din 8 - 64.", "Register", "Cancel");

    format(PlayerInfo[playerid][pName], 24, GetPlayerNameEx(playerid));
    format(PlayerInfo[playerid][pPassword], 128, inputtext);

    gQuery[0] = (EOS);
    mysql_format(SQL, gQuery, sizeof gQuery, "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('%e', '%e', '%e', '%e')", GetPlayerNameEx(playerid), inputtext, GetDateTime(), GetDateTime());
    mysql_tquery( SQL, gQuery, "OnPlayerRegister", "i", playerid);
    
    Dialog_Show(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "E-mail", "Scrie mai jos adresa ta de e-mail:", "Select", "Cancel");
    return true;
}

function OnPlayerRegister(playerid)
{
    PlayerInfo[playerid][pSQLID] = cache_insert_id();
    printf("New account: %s (%d).", GetPlayerNameEx(playerid), playerid);
}

Vezi asa.

Edited by BaFFyJunior
  • 0
Posted
Chiar acum, NuamNume a spus:

mysql_log(LOG_ERROR | LOG_WARNING, LOG_TYPE_TEXT); la asta te referi? sunt prost nu ma pricep... scriptez de 1 sapt

Ma refer la fisierul mysql_log aflat in folderul gamemodeului tau.

  • 0
Posted

[15:10:31 05/19/20] [ERROR] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL] - (error #1054) Unknown column 'RegisterDate' in 'field list' (Query: "INSERT INTO `users` (Name, Password, RegisterDate, LastLogin) VALUES ('R4uL', 'sadsadasda', '15:10:31 - 19/05/2020', '15:10:31 - 19/05/2020')")

  • 0
Posted
Acum 1 minut, NuamNume a spus:

nu cred brooo merge mersi din tot sufletul meu iti raman dator dar trebuie sa mai adaug ceva? ca gen scrie last login 000-000-000 ceva de genu

Nu, campul se actualizeaza la inregistrare.

  • 0
Posted
Acum 20 minute, NuamNume a spus:

Ar fii fost bine, oricum o rezolv eu. Multumesc inca o data!

La default poti pune CURRENT_TIMESTAMP.

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.