Saving teams in stats.
#7

Stop Bumping first. Secondly use Fiki's code above.

Only for Registration code use this.

pawn Код:
if(dialogid == register) //If dialog id is a register 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
            if(!strlen(inputtext)) //If they didn't enter any password
            {// then we will tell to them to enter the password to register
                ShowPlayerDialog(playerid,register,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
                return 1;
            }
            //If they have entered a correct password for his/her account...
            new hashpass[129]; //Now we will create a new variable to hash his/her password
            WP_Hash(hashpass,sizeof(hashpass),inputtext);//We will use whirlpool to hash their inputted text
            new INI:file = INI_Open(Path(playerid)); // we will open a new file for them to save their account inside of Scriptfiles/Users folder
            INI_SetTag(file,"Player's Data");//We will set a tag inside of user's account called "Player's Data"
            INI_WriteString(file,"Password",hashpass);//This will write a hashed password into user's account
            INI_WriteInt(file,"AdminLevel",0); //Write an integer inside of user's account called "AdminLevel". We will set his level to 0 after he registered.
            INI_WriteInt(file,"VIPLevel",0);//As explained above
            INI_WriteInt(file,"Money",0);//Write an integer inside of user's account called "Money". We will set their money to 0 after he registered
            INI_WriteInt(file,"Scores",0);//Write an integer inside of user's account called "Scores". We will set their score to 0 after he registered
            INI_WriteInt(file,"Kills",0);//As explained above
            INI_WriteInt(file,"Deaths",0);//As explained above
            INI_WriteInt(file,"Team",0); //As explained above
            INI_Close(file);//Now after we've done saving their data, we now need to close the file
            SendClientMessage(playerid,-1,"You have been successfully registered");//Tell to them that they have successfully registered a new account
            ShowPlayerDialog(playerid, rules, DIALOG_STYLE_MSGBOX, "Rules", "*Do Not Spam/Flood Chat.\n*Do Not Advertise servers Here.\n*Do Not use Any Third-Party Programme.\nRespect Server Staff and Players.\nEnjoy your Stay :D", "Close", "");
            return 1;
        }
    }
Reply


Messages In This Thread
Saving teams in stats. - by Avi Raj - 05.01.2013, 12:36
Re: Saving teams in stats. - by Franx - 05.01.2013, 12:51
Re: Saving teams in stats. - by fiki574 - 05.01.2013, 14:42
Re: Saving teams in stats. - by Avi Raj - 06.01.2013, 04:23
Re: Saving teams in stats. - by Avi Raj - 06.01.2013, 13:46
Re: Saving teams in stats. - by Avi Raj - 07.01.2013, 02:32
Re: Saving teams in stats. - by Ballu Miaa - 07.01.2013, 02:54
Re: Saving teams in stats. - by Avi Raj - 07.01.2013, 03:58
Re: Saving teams in stats. - by Avi Raj - 07.01.2013, 14:12
Re: Saving teams in stats. - by vMapper - 07.01.2013, 14:34

Forum Jump:


Users browsing this thread: 1 Guest(s)