SA-MP Forums Archive
Need some help regarding some register stuffs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need some help regarding some register stuffs (/showthread.php?tid=471631)



Need some help regarding some register stuffs - Flaken - 24.10.2013

http://pastebin.com/r9iEK7Fk

Код:
 case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);
 
                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
So, I want to remove the quit, to prevent players getting quitted. also, I want players to save the stats without having to relog, how to do so ?

some helps are very highly appriciated


Re: Need some help regarding some register stuffs - reckst4r - 24.10.2013

To remove the getting kicked part, simply remove
pawn Код:
if (!response) return Kick(playerid);
Assuming you already have saving somewhere in the gamemode/filterscript, make it into a function, for example
pawn Код:
forward SavePlayer(playerid);
public SavePlayer(playerid)
{
    //code..
}
and then make a timer executing it every .. seconds/minutes


Re: Need some help regarding some register stuffs - Flaken - 26.10.2013

I still don't understand at 2nd part, what do you mean function of it ?

I don't need timer executing, it's ok.