SA-MP Forums Archive
Reset Variables of an Account through MySQL? - 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: Reset Variables of an Account through MySQL? (/showthread.php?tid=520191)



Reset Variables of an Account through MySQL? - AMouldyLemon - 17.06.2014

pawn Код:
enum MainAccount
{
    mID,
    mPassword[20],
    mEmailAddress[25],
    mCurrentCID,
    mRealName[128],
    bool:mLoggedIn,
    mSuperAdmin,
    mSecretPhrase[28],
    mOriginalUsername[MAX_PLAYER_NAME],
    mOld_IP[20],
    mCharacterString[128],
}
new MasterAccount[MAX_PLAYERS][MainAccount];
Need a public function that sets every Variable to 0 and false for [mLoggedIn].

I have a function already, I do not think it resets the MySQL Variables though. it uses "srtmid".

pawn Код:
forward ResetMasterAccountVariables(playerid);          // Resetting variables upon connection.
public ResetMasterAccountVariables(playerid)
{
    strmid(MasterAccount[playerid][mPassword], "", 128, 128);
    strmid(MasterAccount[playerid][mEmailAddress], "", 128, 128);
    MasterAccount[playerid][mCurrentCID] = -1;                      // 0 = no character in use.
    MasterAccount[playerid][mID] = 0;
    strmid(MasterAccount[playerid][mRealName], "", 128, 128);
    MasterAccount[playerid][mSuperAdmin] = 0;                                      
    strmid(MasterAccount[playerid][mSecretPhrase], "", 128, 128);
    strmid(MasterAccount[playerid][mOriginalUsername], "", 128, 128);
    strmid(MasterAccount[playerid][mOld_IP], "", 128, 128);
    MasterAccount[playerid][mLoggedIn] = false;            
   
}



Re: Reset Variables of an Account through MySQL? - AMouldyLemon - 18.06.2014

Bump


Re: Reset Variables of an Account through MySQL? - Djole1337 - 18.06.2014

pawn Код:
MasterAccount[playerid][mPassword][0] = MasterAccount[playerid][mEmailAddress][0] = MasterAccount[playerid][mRealName][0] = MasterAccount[playerid][mSecretPhrase][0] = MasterAccount[playerid][mOriginalUsername][0] = MasterAccount[playerid][mOld_IP][0] = 0;



Re: Reset Variables of an Account through MySQL? - AMouldyLemon - 18.06.2014

That will reset the Variables set to a players 'Master Account' in the MySQL database?


Re: Reset Variables of an Account through MySQL? - AMouldyLemon - 18.06.2014

Small request, Resetting Variables Public Function. Just an example will do, and a small explanation please. Thanks