need help with dudb saving
#1

I have a problem with dudb, it doesnt really work
please check the code and find out why it doesnt because i couldnt

http://pastebin.com/tKB3Fj59

i took it out from gamemode so maybe some missing brackets or something dont think about it, please hlep me
Reply
#2

What doesn't work?
Reply
#3

It is bugged alot when I join with a unregistered name (i deleted the name in scriptfiles) then it shows me the login dialog and when i type any pass, the login dialog dissapear..
Reply
#4

pawn Код:
public OnPlayerConnect(playerid)
{
    if (udb_Exists(PlayerName(playerid)))
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account", "Login to your account\n\nEnter your password:", "Login", "Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Account", "Register your account\n\nEnter password:", "Register", "Quit");
    }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == 1)
    {
        if(!response) return Kick(playerid);
        if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid,COLOR_GREEN,"%s is not found create an account");
        if (udb_Create(PlayerName(playerid),inputtext))
        {
            SendClientMessage(playerid, COLOR_GREEN, "Your account is now registered");
            return true;
        }
    }
    if (dialogid == 2)
    {
        if(!response) return Kick(playerid);
        if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"%s is already registered please login to your account");
        if(udb_CheckLogin(PlayerName(playerid),inputtext))
        {
            new plrip[32];
            GetPlayerIp(playerid,plrip,sizeof(plrip));
            udb_UserSet(PlayerName(playerid),"IP",plrip);
            udb_UserSet(PlayerName(playerid),"name",PlayerName(playerid));
            SendClientMessage(playerid,COLOR_GREEN, " You have succesfully logged in");
        }
    }
}
Reply
#5

Thank you!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)