new 3D crashing login login script
#1

Hello!

Since i changed to 3D you cant login, when you enter your pass and press enter to spawn, you get disconnected.
Its the same if you make a new account

If someone could take a look and tell me what is bugging for the 3D i would be glad

CODE:
pawn Code:
forward OnPlayerLogin(playerid,password[]);
forward OnPlayerRegister(playerid, password[]);

public OnPlayerLogin(playerid,password[])
{
    if(IsPlayerNPC(playerid)) return 1;
    new file[64];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));

    format(file, sizeof(file), "/Users/%s.ini", playername3);

    if (dini_Exists(file))
    {
        new password2 = num_hash(password);
        if(dini_Int(file,"Password") == password2)
        {
            Member[playerid] = dini_Int(file, "Member");
            Leader[playerid] = dini_Int(file,"Leader");
            IsInOrg[playerid] = dini_Int(file,"Status");
            IsLaw[playerid] = dini_Int(file,"Law");
            request[playerid] = dini_Int(file,"Request");
            IsRequesting[playerid] = dini_Int(file,"Isrequesting");
            SetPlayerScore(playerid, dini_Int(file,"Score"));
            SetPlayerMoney(playerid, dini_Int(file,"Cash"));
            Jail[playerid] = dini_Int(file, "Jail");
            PlayerInfo[playerid][Admin] = dini_Int(file, "Admin");
            Radio[playerid] = dini_Int(file, "Radio");
        }
        else
        {
            gPlayerLogTries[playerid] += 1;
            ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,""ALB"Once againg!",""ALB"You have typed a wrong password\n"ALB"Type your password here to log-in!","Log-in","Quit");
            return 1;
        }
    }
    SpawnPlayer(playerid);
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1234)
    {
        if(response)
        {
            if(IsPlayerNPC(playerid)) return 1;
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername, sizeof(playername));
            new string[64];
            format(string, sizeof(string), "/Users/%s.ini", playername);
            if (dini_Exists(string))
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,""ALB"Welcome.Please log-in.",""ALB"Type your password here to log-in","Log-in","Quit");
            }
            else
            {
                ShowPlayerDialog(playerid, 1246, DIALOG_STYLE_INPUT,""ALB"Please register!",""ALB"Type your password here to register.","Register","Quit");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY,"*You refused. You must accept the rules to play.");

        }
    }
    if(dialogid == 1245)
    {
        if(response)
        {
            strmid(Typed[playerid], inputtext, 0, strlen(inputtext), 255);
            if(!strcmp(Typed[playerid], "None", true))
            {
                ShowPlayerDialog(playerid, 1245, DIALOG_STYLE_INPUT,""ALB"Once again.",""ALB"You didn't type a correct password!\n"ALB"Type you password here to register.","Log-in","Quit");
            }
            else
            {
                OnPlayerLogin(playerid, inputtext);
            }
        }
    }
    if(dialogid == 1246)
    {
        if(response == 1)
        {
            new sendername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new string[512];
            format(string, sizeof(string),""ALB"Nume: "LIGHTBLUE"%s\n"ALB"Pass: "LIGHTBLUE"%s,\n"ALB"Money: "LIGHTBLUE"10000\n"ALB"Score: "LIGHTBLUE"500",sendername,inputtext);
            ShowPlayerDialog(playerid, 1242, DIALOG_STYLE_MSGBOX, ""LIGHTBLUE"Account succesfully registred",string,"Ok","");
            OnPlayerRegister(playerid, inputtext);
        }
    }
    return 1;
}
Reply
#2

This is a nice release. Too bad it did not work as planned. Anyways, did you compile it?
Reply
#3

Quote:
Originally Posted by Diovis
View Post
This is a nice release. Too bad it did not work as planned. Anyways, did you compile it?
You have to compile it before testing it...............


OP: It's a bug. Try using SetPlayerSpawnInfo before using SpawnPlayer.
Reply
#4

Quote:
Originally Posted by Schurman
View Post
You have to compile it before testing it...............



OP: It's a bug. Try using SetPlayerSpawnInfo before using SpawnPlayer.
Quote:
Originally Posted by Diovis
View Post
This is a nice release. Too bad it did not work as planned. Anyways, did you compile it?
Yes i have compiled the whole GM.

What do you mean with "SetPlayerSpawnInfo before using SpawnPlayer" ?
Reply
#5

He means that when you use SpawnPlayer while in class selection with SA-MP 0.3d R2, the kicks you at spawn. This can be fixed by using the function SetSpawnInfo before SpawnPlayer or by downloading SA-MP 0.3d R1.
Reply
#6

Quote:
Originally Posted by Basssiiie
View Post
He means that when you use SpawnPlayer while in class selection with SA-MP 0.3d R2, the kicks you at spawn. This can be fixed by using the function SetSpawnInfo before SpawnPlayer or by downloading SA-MP 0.3d R1.
The only thing i use for spawn info is in OnPlayerSpawn, and the login reads what team member you are from the userfile, and when you spawn you should spawn at the right place an not get disconnected, so can you help me how to make it "SetSpawnInfo before SpawnPlayer" ? bc im not sure how to do it

EDIT: it also worked if i removed the auto spawn when login with pass and spawn manual with the button.
Reply
#7

Code:
SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 5.0, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
In SA-MP 0.3d R2 there's just a bug that kicks the player if you use SpawnPlayer in de class selection menu. You can avoid the kick by using first SetSpawnInfo and then SpawnPlayer, or by downloading SA-MP 0.3d R1.
Reply
#8

I've posted this issue weeks ago: https://sampforum.blast.hk/showthread.php?tid=303454
Reply
#9

Thanks all, i get what you mean now ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)