Just a simple help - 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)
+--- Thread: Just a simple help (
/showthread.php?tid=577358)
Just a simple help -
STONEGOLD - 11.06.2015
How can i put User name here.
I'm using this:
PHP код:
public OnAccountCheck(playerid)
{
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
cache_get_field_content(0, "Password", Player[playerid][Password], mysql, 129);
Player[playerid][IDs] = cache_get_field_content_int(0, "IDs");
ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_INPUT, "Login", "Welcome back!\n\nType your password below to log in.\n\nIf this is not your account,please join with \nanother username - this one is taken!\n", "Login", "Quit");
}
else
{
ShowPlayerDialog(playerid, RegisterDialog, DIALOG_STYLE_INPUT, "Register", "Welcome !\n\nYour account is not registered yet!\nType your password into the box below to register your account.", "Register", "Quit");
}
return true;
}
and I want to make it like this:
PHP код:
stock ShowPlayerLoginDialog(playerid, info[])
{
dialog = "";
format(dialog, sizeof(dialog),
"Welcome back, %s!\n\nType your password below to log in.\n\nIf this is not your account,please join with \nanother username - this one is taken!\n\n%s",
pData[playerid][Name], info);
ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "Login", dialog, "Login", "Quit");
return 1;
}
Idk
I want put player name here. Idk how i tired . Anyone help?
Re: Just a simple help -
J0sh... - 11.06.2015
PHP код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
Then replace pData[playerid][Name] with that^
Re: Just a simple help -
SickAttack - 11.06.2015
pawn Код:
stock ShowPlayerLoginDialog(playerid, info[])
{
new string[256];
format(dialog, sizeof(dialog), "Welcome back, %s!\n\nType your password below to log in.\n\nIf this is not your account, please join with\nanother \
username - this one is taken!\n\n%s", PlayerName(playerid), info);
return ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "Login", dialog, "Login", "Quit");
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
Re: Just a simple help -
STONEGOLD - 11.06.2015
Thanks, But this script is buggy. I'm using this,
https://sampforum.blast.hk/showthread.php?tid=574714.
You can login with wrong password and also it gives you double money when you re-join. I have posted on his thread if he wants to check. Anyways, Is there any best MYSQL register/login saving system tut?
Re: Just a simple help -
SickAttack - 11.06.2015
http://forum.sa-mp.com/search.php?searchid=9582356
Re: Just a simple help -
STONEGOLD - 11.06.2015
Rep you bro. Thanks