Login System Via ShowPlayerDialog
#1

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!
Reply
#2

Can you do a example please?
Reply
#3

There is an example on the wiki.

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply
#4

It dont use DUDB?
Reply
#5

Logic? It sends the data to be parsed by OnDialogResponse, YOU sort the DUDB bit out for OnDialogResponse.
Reply
#6

I know all that but all im stuck on is how to intergrate with DUDB
Reply
#7

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[])
Reply
#8

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
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)