Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: mijata poslato Januar 07, 2015, 09:52:36 PRE PODNE

Naslov: [POMOC]LOGIN PROBLEM
Poruka od: mijata poslato Januar 07, 2015, 09:52:36 PRE PODNE
Skripta koju koristim:DM
Detaljan opis problema:e ovako kada probam da se login nece samo se zatvori dijalog kada ukucam sifru i ako ponovo kucam /register opet se otvori i nemogu da se spawn...?
Dio skripte:

Citatnew bool:IsRegistred[MAX_PLAYERS]; // after includes

Citatpublic OnPlayerConnect(playerid)
{

    IsRegistred[playerid] = false;

Citatpublic OnPlayerSpawn(playerid)
{
    if(IsRegistred[playerid] != true)
{
    ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX," {FB0404}You must register an account", "You must register an account if you wish to play on this server!", "Ok", "");
    SetTimerEx("KickPlayer",200,false,"d", playerid);
}

  if(dialogid == DIALOG_REGISTER)
    {
    switch(response)
    {
        case 0:
        {

            IsRegistred[playerid] = false;
        }
        case 1:
        {
            new Jfile[100], pIP[16], string[40], str[60], buf[145], year, month, day, hour, mins, sec;
            new seconds = gettime() - pInfo[playerid][ConnectedTime]+pInfo[playerid][TotalSecs];

            if(strlen(inputtext) < 3 || strlen(inputtext) > 20)
            {
                ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"Registration Error", "Enter the password:\n{FF0000}*Password length must be between 3 - 20 characters", "Register", "No Thanks");
            }
            else if(strlen(inputtext) > 2 && strlen(inputtext) < 21)
            {
                getdate(year, month, day);
                gettime(hour,mins,sec);
                GetPlayerIp(playerid,pIP,16);

                format(string, 40,"%d/%d/%d at %d:%d:%d", day,month,year,hour,mins,sec);
                format(str, 60,"%d/%d/%d at %d:%d:%d", day,month,year,hour,mins,sec);
                format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));

                WP_Hash(buf, sizeof(buf),inputtext);

                new INI:ACCOUNT = INI_Open(Jfile);
                INI_WriteString(ACCOUNT, "RegisteredOn", string);
                INI_WriteString(ACCOUNT, "RegisteredIP", pIP);
                INI_WriteString(ACCOUNT, "LastLoggedIP", pIP);
                INI_WriteString(ACCOUNT, "Password",buf);
                INI_WriteInt(ACCOUNT, "Level", 0);
                INI_WriteInt(ACCOUNT, "Banned", 0);
                INI_WriteInt(ACCOUNT, "Donator", 0);
                INI_WriteInt(ACCOUNT, "Score", START_SCORE);
                INI_WriteInt(ACCOUNT, "Cash", START_CASH);
                INI_WriteInt(ACCOUNT, "Kills", 0);
                INI_WriteInt(ACCOUNT, "Deaths", 0);
                INI_WriteInt(ACCOUNT, "Skin", 0);
                INI_WriteInt(ACCOUNT, "Muted", 0);
                INI_WriteInt(ACCOUNT, "Autologin", 1);
                INI_WriteInt(ACCOUNT, "TotalSeconds", seconds);
                INI_WriteString(ACCOUNT, "TotalSpentTime", ConvertTime(seconds,mins,hour,day));
                INI_WriteString(ACCOUNT, "LastSeen", str);
                INI_Close(ACCOUNT);

                pInfo[playerid][Registered] = 1;
                pInfo[playerid][Logged] = 1;
                IsRegistred[playerid] = true;

                #if LoginTextDraw == true
                TextDrawHideForPlayer(playerid, TEXT_PASSWORD);
                TextDrawHideForPlayer(playerid, TEXT_REGISTER);
                TextDrawHideForPlayer(playerid, TEXT_REGISTERED);
                CancelSelectTextDraw(playerid);
                #endif

                format(Jstring, 125, "Your nickname has been successfully registered! | Account: \"%s\" | Password: %s", GetName(playerid), inputtext);
                SendClientMessage(playerid,0x008000C8,Jstring);
            }
        }
    }
    if(dialogid == DIALOG_LOGIN)
    {
        if(response)
        {
            new Jfile[100],pIP[16],buf[145];
            format(Jfile, 60, ACCOUNTS_PATH, GetName(playerid));
            INI_ParseFile(Jfile, "GetPassword", .bExtra = true, .extra = playerid);
            WP_Hash(buf, sizeof(buf),inputtext);

            if(strcmp(pInfo[playerid][Password], buf, false) == 0)
            {
                format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
                INI_ParseFile(Jfile, "LoginPlayer", .bExtra = true, .extra = playerid);
                SendClientMessage(playerid,green,"You have been succesfully logged In!");

                SetPlayerScore(playerid, pInfo[playerid][Score]);
                GivePlayerMoney(playerid, pInfo[playerid][Cash]);
                IsRegistred[playerid] = true;
                pInfo[playerid][Logged] = 1;

                GetPlayerIp(playerid,pIP,16);
                format(Jfile, 100, ACCOUNTS_PATH, GetName(playerid));
                new INI:ACCOUNT = INI_Open(Jfile);
                INI_WriteString(ACCOUNT, "LastLoggedIP", pIP);
                INI_Close(ACCOUNT);
                #if LoginTextDraw == true
                TextDrawHideForPlayer(playerid, TEXT_PASSWORD);
                TextDrawHideForPlayer(playerid, TEXT_REGISTER);
                TextDrawHideForPlayer(playerid, TEXT_REGISTERED);
                CancelSelectTextDraw(playerid);
                #endif
            }
            else
            {
                pInfo[playerid][LoginAttempts]++;
                if(pInfo[playerid][LoginAttempts] >= MAX_LOGIN_ATTEMPTS)
                {
                    format(Jstring, sizeof(Jstring),"%s has been automatically kicked | Reason: 'Incorrect password'", GetName(playerid));
                    SendToAdmins(orange,Jstring);
                    ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX, "WARRING","You have been automatically kicked | Reason: 'Incorrect password'", "Ok", "");
                    SetTimerEx("KickPlayer",100,false,"d",playerid);
                    return 1;
                }
                format(Jstring, sizeof(Jstring),"Account \"%s\"\nEnter your password to login\n{FF0000}*Incorrect password", GetName(playerid));
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Account Login error",Jstring, "Login", "Quit");
            }
        }
        #if LoginTextDraw == false
        else SetTimerEx("KickPlayer",100,false,"d",playerid);
        #endif
    }
    return true;
}




Neke slike/video za lakse dobivanje pomoci(neobavezno):
Naslov: Odg: [POMOC]LOGIN PROBLEM
Poruka od: ▂ ▃ ▅ Rudimental ▅ ▃ ▂ poslato Januar 07, 2015, 15:06:31 POSLE PODNE
Pogledaj ovu liniju
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX," {FB0404}You must register an account", "You must register an account if you wish to play on this server!", "Ok", "");

E sada ti si ovde stavio za ID dialoga JDIALOGS+45 a u onom ostalom kodu ja ne vidim ovaj ID mislim naziv ali je to ustvari dialogid. Vidi to da sredis.