Login register SyS

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hi,
    Ich habe zwar ein Script, aber das Login register Sys funktioniert nicht richtig.
    hier die Zeilen:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    enum pInfo
    {
    pKey[128],
    pLevel,
    pHarndrang,
    pTabbak,
    pTsucht,
    pNeedT,
    [...]


    public PlayerUpdate(playerid)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
    {
    M_OnPlayerUpdate(playerid);
    new string3[64];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "/Accounts/%s.ini", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[32];
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
    format(var, 32, "Hunger=%d\n", PlayerInfo[playerid][pHunger]);fwrite(hFile, var);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
    format(var, 32, "Harndrang=%d\n",PlayerInfo[playerid][pHarndrang]);fwrite(hFile, var);
    format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pDonateRank]);fwrite(hFile, var);
    format(var, 32, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
    format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
    format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
    format(var, 32, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
    format(var, 32, "Origin=%d\n",PlayerInfo[playerid][pOrigin]);fwrite(hFile, var);
    format(var, 32, "CK=%d\n",PlayerInfo[playerid][pCK]);fwrite(hFile, var);



    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    public OnPlayerRegister(playerid, password[])
    {
    if(IsPlayerConnected(playerid))
    {
    new string3[64];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "/Accounts/%s.ini", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255);
    new var[32];
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    format(var, 32, "NeedSex=%d\n",PlayerInfo[playerid][pNeedSex]);fwrite(hFile, var);
    format(var, 32, "Durst=%d\n",PlayerInfo[playerid][pDurst]);fwrite(hFile, var);
    format(var, 32, "Ban=%d\n",PlayerInfo[playerid][pBan]);fwrite(hFile, var);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
    format(var, 32, "Harndrang=%d\n",PlayerInfo[playerid][pHarndrang]);fwrite(hFile, var);
    format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pDonateRank]);fwrite(hFile, var);
    format(var, 32, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
    format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
    format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



    public OnPlayerLogin(playerid,password[])
    {
    new tmp2[256];
    new string2[128];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
    new PassData[256];
    new keytmp[256], valtmp[256];
    fread( UserFile , PassData , sizeof( PassData ) );
    keytmp = ini_GetKey( PassData );
    if( strcmp( keytmp , "Key" , true ) == 0 )
    {
    valtmp = ini_GetValue( PassData );
    strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
    }
    if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
    {
    new key[ 256 ] , val[ 256 ];
    new Data[ 256 ];
    while ( fread( UserFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey( Data );


    if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
    if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
    if( strcmp( key , "DonateRank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDonateRank] = strval( val ); }
    if( strcmp( key , "ConnectedTime" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pConnectTime] = strval( val ); }
    if( strcmp( key , "Registered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pReg] = strval( val ); }
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Habe mal alles wo der Key drinnen ist gepostet.
    Das Problem ist das Password.
    Es wird richtig gespeichert aber nach nem Restart oder nach nem neuconnect ist es weg und man kommt mit allem oder nix rein...
    Hoffe mir kann jemand helfen.

  • Was genau funktioniert darin nicht? Bitte das Problem genauer beschreiben, dann kann ich dir weiter helfen.
    Habe das Script ebenfalls sehr sehr lange verwendet.