07.04.2014, 10:22
Like the title says my register and login system is not loading STATS! please help!
Please help guyz
Code:
public loadaccount_user(playerid, name[], value[]) { INI_String("Password", pInfo[playerid][Pass],129); /*we will use INI_String to load user's password. ("Password",.. will load user's password inside of user's path. 'pInfo[playerid][Pass]',...We have defined our user's variable above called, pInfo. Now it's time to use it here to load user's password. '129',... 129 is a length of a hashed user's password. Whirlpool will hash 128 characters + NULL*/ INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);/*We will use INI_Int to load user's admin level. INI_Int stands for INI_Integer. This load an admin level. */ INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);//As explained above INI_Int("Money",pInfo[playerid][Money]); //As explained above INI_Int("Scores",pInfo[playerid][Scores]);//As explained above INI_Int("Kills",pInfo[playerid][Kills]);//As explained above INI_Int("Deaths",pInfo[playerid][Deaths]);//As explained above return 1; }
Code:
if(dialogid == dlogin) //If dialog id is a login dialog {//then if(!response) return Kick(playerid); //If they clicked the second button "Quit", we will kick them. if(response) //if they clicked the first button "Register" {//then new hashpass[129]; //Will create a new variable to hash his/her password WP_Hash(hashpass,sizeof(hashpass),inputtext); //Will hash inputted password if(!strcmp(hashpass, pInfo[playerid][Pass], false)) //If they have insert their correct password {//then INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);//We will load his account's data from user's path SetPlayerScore(playerid,pInfo[playerid][Scores]);//We will get their score inside of his user's account and we will set it here GivePlayerMoney(playerid,pInfo[playerid][Money]);//As explained above SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");//Tell them that they've successfully logged in } else //If they've entered an incorrect password {//then ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");//We will tell to them that they've entered an incorrect password return 1; } } } return 1; }