22.07.2014, 09:48
For the last few days, I've been working on a mission switching gamemode and I came across a problem. Everytime the mission changes, I have to reload the Base.pwn filterscript, which includes the login and registration system and all the commands. The things is, it becomes annoying have to login everytime the mission switches, which the players will, at some point, get tired of doing.
I wanted to know if there's a workaround this, or If I really have to use the player's IP for this. What can be done? If it helps, the code on OnPlayerConnect will be left just below this paragraph. Thanks for your time.
I wanted to know if there's a workaround this, or If I really have to use the player's IP for this. What can be done? If it helps, the code on OnPlayerConnect will be left just below this paragraph. Thanks for your time.
pawn Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("tPoints", 3600000, true, "i", playerid);
new pName[MAX_PLAYER_NAME],
dialogTitle[21],
string[48 + MAX_PLAYER_NAME+1];
format(dialogTitle, sizeof(dialogTitle), "%s", SERVER_NAME);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "{6FDD96}Server: {FFFFFF}%s has joined the server.", pName);
SendClientMessageToAll(-1, string);
if(fexist(Path(playerid)))
{
INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid); //Will load user's data using INI_Parsefile.
ShowPlayerDialog(playerid,dLogin,DIALOG_STYLE_PASSWORD,dialogTitle,"Welcome back. Your account is registered in our users database.\nProcceed by typing your password in the blank space below and logging in.","Login","Quit");//Login dialog
}
else
{
ShowPlayerDialog(playerid,dRegister,DIALOG_STYLE_PASSWORD,dialogTitle,"Welcome to our server. Your account is not registered in our users database.\nProcceed by typing your password in the blank space below and registering.","Register","Quit");//Registration dialog
return 1;
}
return 1;
}