That would mean going back to where I came from...
There was a timer, which I removed. But the problem remains :/
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_REGISTER)
{
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,COLOR_WHITE,"You are already logged in!");//Checking if the player is logged in, if he is, it won't allow him to re-register
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Password invalid, Enter your password:", "Register", "");
new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
GetPlayerName(playerid,PlayerName,sizeof PlayerName);
format(file,sizeof file,"Admin/%s.ini",PlayerName);
if(fexist(file)) return SendClientMessage(playerid,COLOR_WHITE,"Somehow you're already registered!");
INI_Open(file);
INI_WriteString("Password",inputtext);
INI_WriteInt("Level",PInfo[playerid][Level]);
INI_Save();
INI_Close();
SendClientMessage(playerid,COLOR_GREEN,"Registered");
GameTextForPlayer(playerid, "~g~Thank you for registering, enjoy your stay",4000,0);
InterpolateCameraPos(playerid,-3100.8394,2964.5935,10.7787,-3087.0117,2977.9360,8.0252, 2000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid,-3068.4573,2987.2256,2.2427 + 3, -3074.7300,2987.9231,3.1354 + 3, 2000, CAMERA_MOVE);
PInfo[playerid][Logged] = 1;
TextDrawShowForPlayer(playerid, TD_INFO[playerid]);
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
MovePlayerObject(playerid, ClassGate, -3090.1604004,2971.1838379,11.7469883 + 10, 5);
CreateExplosion(-3087.0117,2977.9360,8.0252, 1, 20.0);
PlayerPlaySound(playerid, 1185, -3087.0117,2977.9360,8.0252);
}
if(dialogid == DIALOG_LOGIN)
{
if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,COLOR_WHITE,"You are already logged in!");//Checking if the player is logged in, if he is, it won't allow him to login
new password[23],password2[23];//Creating a variable to store the password, and another one to store the password from the user's file.
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Password invalid, Enter your password:", "Login", "");
InterpolateCameraPos(playerid,-3100.8394,2964.5935,10.7787,-3085.6050,2978.3179,8.0414, 2000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid,-3068.4573,2987.2256,2.2427 + 3, -3074.7300,2987.9231,3.1354 + 3, 2000, CAMERA_MOVE);
new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
GetPlayerName(playerid,PlayerName,sizeof PlayerName);
format(file,sizeof file,"Admin/%s.ini",PlayerName);
if(!fexist(file)) return SendClientMessage(playerid,COLOR_WHITE,"Please use /register");//Checking if the player is not registered, again....
INI_Open(file);//Opening the file with SII include
INI_ReadString(password2,"Password");
if(strcmp(password,password2) != 0) return SendClientMessage(playerid,COLOR_WHITE,"Wrong password!"),INI_Close();//Checking if he inputted the correct password, if not, retrieve him a message and closing the file;
PInfo[playerid][Level] = INI_ReadInt("Level");//Setting the admin level variable, to the one thats in his file.
PInfo[playerid][Score] = INI_ReadInt("Score");
PInfo[playerid][Money] = INI_ReadInt("Money");
PInfo[playerid][Kills] = INI_ReadInt("Kills");
PInfo[playerid][Skin] = INI_ReadInt("Skin");
PInfo[playerid][Rep] = INI_ReadInt("Reps");
PInfo[playerid][Deaths] = INI_ReadInt("Deaths");
PInfo[playerid][VortexPB] = INI_ReadFloat("VortexPB");
GivePlayerMoney(playerid, INI_ReadInt("Money"));
SetPlayerScore(playerid, PInfo[playerid][Score]);
//SetPlayerSkin(playerid, PInfo[playerid][Skin]);
SetPlayerColor(playerid, INI_ReadInt("Color"));
INI_Close();
new stats[128];
format(stats,sizeof stats,"Score: %i | Money: %i | Kills %i | Deaths %i | Admin level %i | Reputation %i", PInfo[playerid][Score], PInfo[playerid][Money], PInfo[playerid][Kills], PInfo[playerid][Deaths], PInfo[playerid][Level], PInfo[playerid][Rep]);
SendClientMessage(playerid,COLOR_GREEN,"You have been successfully logged in!");
SendClientMessage(playerid,COLOR_GREEN,"Your stats progress will be automatically saved from now on!");
SendClientMessage(playerid,COLOR_ADMIN_BLUE,"Current stats:");
SendClientMessage(playerid,COLOR_ADMIN_BLUE,stats);
PInfo[playerid][Logged] = 1;
TextDrawShowForPlayer(playerid, TD_INFO[playerid]);
ApplyAnimation(playerid,"DANCING","DNCE_M_B",4.0,1,0,0,0,-1);
MovePlayerObject(playerid, ClassGate, -3090.1604004,2971.1838379,11.7469883 + 10, 5);
CreateExplosion(-3087.0117,2977.9360,8.0252, 1, 20.0);
PlayerPlaySound(playerid, 1185, -3087.0117,2977.9360,8.0252);
}