04.06.2011, 17:41
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:
Thank you very much!
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;
}
![Wink](images/smilies/wink.png)