Login System Via ShowPlayerDialog - 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: Login System Via ShowPlayerDialog (
/showthread.php?tid=97278)
Login System Via ShowPlayerDialog -
Kyle - 13.09.2009
Hello, Im using ShowPlayerDialog and i want a login system
So when they type there password in the box and click ok if correct it loggs them in,
By the way im using DracoBlues login / register system.
I think its called DUDB
Thanks!
Re: Login System Via ShowPlayerDialog -
Kyle - 13.09.2009
Can you do a example please?
Re: Login System Via ShowPlayerDialog -
Calgon - 13.09.2009
There is an example on the wiki.
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/OnDialogResponse
Re: Login System Via ShowPlayerDialog -
Kyle - 13.09.2009
It dont use DUDB?
Re: Login System Via ShowPlayerDialog -
Calgon - 13.09.2009
Logic? It sends the data to be parsed by OnDialogResponse, YOU sort the DUDB bit out for OnDialogResponse.
Re: Login System Via ShowPlayerDialog -
Kyle - 13.09.2009
I know all that but all im stuck on is how to intergrate with DUDB
Re: Login System Via ShowPlayerDialog -
Calgon - 13.09.2009
Quote:
Originally Posted by KyleSmith
I know all that but all im stuck on is how to intergrate with DUDB
|
Copy your authentication code for logging in, then use OnDialogResponse:
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
DracoBlue Login System / Register System -
Kyle - 13.09.2009
I am trying to intergrate Dracoblues login system to work with ShowPlayerDialog
So when your password is typed in the box it logs you in
Ive tried
Quote:
if(dialogid == 1 && response == 1)
{
if(udb_UserInt(nickname,"password_hash")==udb_hash (pwd))
{
}
}
|
But that dont work
Here is the stock to check the password
Quote:
stock udb_CheckLogin(nickname[],pwd[]) {
new fname[MAX_STRING];
format(fname,sizeof(fname),"%s.dudb.sav",udb_encod e(nickname));
if (udb_UserInt(nickname,"password_hash")==udb_hash(p wd)) return true;
return false;
}
|
Thankss
Re: Login System Via ShowPlayerDialog -
JaTochNietDan - 13.09.2009
Quote:
Originally Posted by KyleSmith
I am trying to intergrate Dracoblues login system to work with ShowPlayerDialog
So when your password is typed in the box it logs you in
Ive tried
Quote:
if(dialogid == 1 && response == 1)
{
if(udb_UserInt(nickname,"password_hash")==udb_hash (pwd))
{
}
}
|
But that dont work
Here is the stock to check the password
Quote:
stock udb_CheckLogin(nickname[],pwd[]) {
new fname[MAX_STRING];
format(fname,sizeof(fname),"%s.dudb.sav",udb_encod e(nickname));
if (udb_UserInt(nickname,"password_hash")==udb_hash(p wd)) return true;
return false;
}
|
Thankss
|
"pwd" isn't defined in "OnDialogResponse".
Use udb_hash(inputtext) instead.
Also, neither is "nickname", so define that also.
Re: Login System Via ShowPlayerDialog -
Kyle - 13.09.2009
Quote:
Originally Posted by JaTochNietDan
Quote:
Originally Posted by KyleSmith
I am trying to intergrate Dracoblues login system to work with ShowPlayerDialog
So when your password is typed in the box it logs you in
Ive tried
Quote:
if(dialogid == 1 && response == 1)
{
if(udb_UserInt(nickname,"password_hash")==udb_hash (pwd))
{
}
}
|
But that dont work
Here is the stock to check the password
Quote:
stock udb_CheckLogin(nickname[],pwd[]) {
new fname[MAX_STRING];
format(fname,sizeof(fname),"%s.dudb.sav",udb_encod e(nickname));
if (udb_UserInt(nickname,"password_hash")==udb_hash(p wd)) return true;
return false;
}
|
Thankss
|
"pwd" isn't defined in "OnDialogResponse".
Use udb_hash(inputtext) instead.
Also, neither is "nickname", so define that also.
|
After some hours i managed to make it work thanks alot JaTochNietDan