Dialog login/register - Fast question - 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: Dialog login/register - Fast question (
/showthread.php?tid=259453)
Dialog login/register - Fast question -
sim_sima - 04.06.2011
Hey guys. I have made a gamemode with a login/register using dialogs with DJson.
I discovered that when the third player joins the server, the login or regisster dialog doesnt show for him.
That means that only 2 players can play in the server aat same time. I looked through my 'OnPlayerConnect' callback, but couldnt find any errors. Now im asking you. Here is the callback:
pawn Код:
public OnPlayerConnect(playerid)
{
gPlayerLogged[playerid] = 0;
OnceLoggedIn[playerid] = 0;
JobRegister[playerid][playerid] = 0;
SetTimerEx("CheatCheck", 3000, true, "d", playerid);
new name[MAX_PLAYER_NAME], file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), UserFile, name);
new rand = random(sizeof(RandomSound));
PlayerPlaySound(playerid, RandomSound[rand], 0, 0, 0);
if(!fexist(file))
{
new string[62 + MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "( ! ) The username '%s' is not registered. Please enter a password",name);
SendClientMessage(playerid, COLOR_GREEN, string);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "{FFFF00}Hopes Hills RPG Account", "{009900}Register new account\n{FFFFFF}Enter a password", "Register", "Quit");
}
else
{
new string[69 + MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "( ! ) The username '%s' is already registered. Please enter your password",name);
SendClientMessage(playerid, COLOR_GREEN, string);
SendClientMessage(playerid, COLOR_GREY, "( ! ) Not your account? Then relog with another name");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "{FFFF00}Hopes Hills RPG Account", "{FFFFFF}Enter your password", "Login", "Quit");
}
return 1;
}
Thank you very much!
Re: Dialog login/register - Fast question -
sim_sima - 04.06.2011
Exactely! Nothing looks wrong....
Re: Dialog login/register - Fast question -
sim_sima - 04.06.2011
Ill figure something out
Re: Dialog login/register - Fast question -
Madsen - 07.06.2011
fixed!! why are you writing with yourself xD?