Jump to content

Problema


IosifR

Recommended Posts

Salut. Am serverul făcut pe Dini și nu știu cum să fac sa salveze bani și levelul înafara de parola și numele salvat in folderul Utilizatori/&s.ini,  sper că înțelegeți ce vreau sa zis. As rămâne recunoscător dacă mă ți ajuta!👐🙏

 

Link to comment
Share on other sites

Am FilterScriptul asta(facut de Flowmen, putin editat textele de mine):

Citat

#include <a_samp>
#include <Dini>

#define Register 0
#define Logged 1

new Login[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Login[playerid] = 0;
    new nombre[MAX_PLAYER_NAME], archivo[256];
    GetPlayerName(playerid, nombre, sizeof(nombre));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombre);
    if (!dini_Exists(archivo))
{
    ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, "Register", "Bine ai venit pe ExtraGaming\nIntrodu o parola pentru a te inregistra!", "Enter", "Cancel");
}
    else
{
    ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_PASSWORD, "Login", "Bine ai revenit!\nIntrodu parola pentru a te loga!", "Enter", "Cancel");
}
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == Register)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, "Register", "Bine ai venit pe ExtraGaming\nInregistreaza-te!", "Register", "Cancel");
    if (!response) return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, "Register", "Bine ai venit pe ExtraGaming\nInregistreaza-te!", "Register", "Cancel");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    dini_Create(archivo);
    dini_Set(archivo, "User", nombrejugador);
    dini_Set(archivo, "Password", inputtext);
    ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_PASSWORD, "Login", "Bine ai revenit!\nIntrodu-ti parola mai jos pentru a te loga!", "Login", "Cancel");
}

    if (dialogid == Logged)
{
    new nombrejugador[MAX_PLAYER_NAME], archivo[256], comprobante[256];
    if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_PASSWORD, "Login", "Bine ai revenit!\nLogheaza-te!", "Login", "Cancel");
    if (!response) return ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_PASSWORD, "Login", "Bine ai revenit!\nLogheaza-te!", "Login", "Cancel");
    GetPlayerName(playerid, nombrejugador, sizeof(nombrejugador));
    format(archivo, sizeof(archivo), "/Users/%s.ini", nombrejugador);
    format(comprobante, sizeof(comprobante), "%s", dini_Get(archivo, "Password"));
    if (!strcmp (inputtext, comprobante))
    {
        Login[playerid] = 1;
    }
    else
    {
        ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_PASSWORD, "Login", "Bine ai revenit!\nLogheaza-te!", "Login", "Cancel");
    }
}
    return 1;
}
 

 

Edited by IosifR
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.