SA-MP Forums Archive
My Register System Problem - 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: My Register System Problem (/showthread.php?tid=610523)



My Register System Problem - CarRamper - 25.06.2016

Hello Guys I have Made A System that a Player Can Only Register A Account If He Had Played On The Server for 10 Min.The Command Is Doing his Work Properly It Don't Allow people To Register Before 10 mins of connect.But i Am Having A Problem That If A Player Don't Register After 10 mins The Script Makes His Account In Scriptfile.

What Should I Show u To Fix It Please Tell Me i Will Give u the Code


Re: My Register System Problem - Lynn - 25.06.2016

Under OnPlayerDisconnect, or wherever you save account function is called,
create a 'if' statement for if he's a registered member or not.
I.E
PHP код:
//Global
new boolIsRegAcct[MAX_PLAYERS];
if(
IsRegAcct[playerid] == true)
{
   
// SAVE ACCOUNT

Also don't forget after the player registers(If they do) to turn the Boolean to true.

PHP код:
/* THIS IS A EXAMPLE
    THIS EXACT CODE WILL NOT WORK AT FACE VALUE
*/
CMD:register(playeridparams[])
{
    if(!
IsRegAcct[playerid] == true
    {
        if(
GetPVarInt(playerid#AllowedAcct) == 1)
        
{
            
IsRegAcct[playerid] = true;
        }
    }
    return 
true;