SA-MP Forums Archive
need help with dudb saving - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help with dudb saving (/showthread.php?tid=228827)



need help with dudb saving - xir - 20.02.2011

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


Re: need help with dudb saving - MadeMan - 20.02.2011

What doesn't work?


Re: need help with dudb saving - xir - 20.02.2011

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..


Re: need help with dudb saving - MadeMan - 20.02.2011

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");
        }
    }
}



Re: need help with dudb saving - xir - 21.02.2011

Thank you!!!!