SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Gamemode Scripts

Reply
 
Thread Tools Display Modes
Old 29/12/2016, 02:36 PM   #1
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,639
Reputation: 625
Default [MySQL/SQLite] Advance Login & Register System (base script)

Advance Login & Register System
MySQL and SQLite - v2.0 - last updated 5th Jan, 2017
  • Dialogs based login and register. There is a limit on login attempts (default is 3) you can edit the limit in script:
    PHP Code:
    #define MAX_LOGIN_ATTEMPTS 3
    #define MAX_ACCOUNT_LOCKTIME 2 // in minutes - this is the time interval for locking the account when a user fails to login in Max Attempts given 
    http://i.imgur.com/lD8XDLm.jpg

  • SECURE_PASSWORD_ONLY
    This forces the user to have atleast 1 Lowercase, 1 Highercase and 1 Number in their password while registration or changing password.
    Modify in script:
    PHP Code:
    //#define SECURE_PASSWORD_ONLY // this forces the user to have atleast 1 Lowercase, 1 Highercase and 1 Number in their password 
  • Per player based password salts, every player has their own SALT for SHA256 salt.

  • When you are unsure about your login credentials, there is a button "OPTIONS" in login or register dialog:


    • Forgot password: gives a dialog where you can answer your security question and reset password:


      When you answer it right (note: you are given the same number of max tries as given in login)


    • Forgot username: gives a dialog where you can get all the accounts that are registered on your IP Address (it cover IP range)!

  • This is what happens when you fail all login attempts:
    The accounts gets temp locked for the given time "MAX_ACCOUNT_LOCKTIME" only for your IP. in case the original user isn't being abused by fake attempts from other IP.s.

    You can also set the maximum login attempts via setting: (note this value also sets maximum attempts to reset password through answering security question)
    PHP Code:
    #define MAX_LOGIN_ATTEMPTS 3 
    Account getting locked (when you fail all 3 attempts):


    When you try to come back right after:


  • /changepass
    Change your account's password. (salt remains the same)


  • /changeques
    Change your account's security question and answer. (salt remains the same)



    You can also add your own questions list by editing this constant array:
    PHP Code:
    new const SECURITY_QUESTIONS[][MAX_SECURITY_QUESTION_SIZE] =
    {
        
    "What was your childhood nickname?", ...
    }; 
  • /stats

Download
SQLite Version - https://github.com/Agneese-Saini/SA-...ase/sqlite.pwn
MySQL Version - https://github.com/Agneese-Saini/SA-...base/mysql.pwn

Libraries required:
zcmd.inc - http://forum.sa-mp.com/showthread.php?t=576114
sscanf2.inc - http://forum.sa-mp.com/showthread.php?t=602923
easydialog.inc - http://forum.sa-mp.com/showthread.php?t=602886
kickban.inc - https://github.com/Agneese-Saini/SA-...de/kickban.inc
__________________

Retired from SA-MP



Last edited by Gammix; 01/06/2017 at 08:10 AM.
Gammix is offline   Reply With Quote
Old 29/12/2016, 02:39 PM   #2
TopShooter
Big Clucker
 
TopShooter's Avatar
 
Join Date: Jan 2016
Location: Unknown
Posts: 85
Reputation: 88
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Awesome and very useful for beginners, keep it up.
TopShooter is offline   Reply With Quote
Old 29/12/2016, 03:40 PM   #3
RyderX
Banned
 
Join Date: Oct 2016
Location: Lebanon,Beirut Rank: SA-MP Scripter
Posts: 602
Reputation: 53
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Nicely done!
RyderX is offline   Reply With Quote
Old 29/12/2016, 05:47 PM   #4
RedRex
Huge Clucker
 
RedRex's Avatar
 
Join Date: Jan 2016
Location: Jordan
Posts: 409
Reputation: 22
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Nice Job, But didn't this a Filterscirpt? Because its a Login & Register System not a gamemode...
RedRex is offline   Reply With Quote
Old 29/12/2016, 07:43 PM   #5
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,639
Reputation: 625
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Quote:
Originally Posted by RedRex View Post
Nice Job, But didn't this a Filterscirpt? Because its a Login & Register System not a gamemode...
Its a starter gamemode; you can implement this as a filterscript if you want it to be as a seperate script as an admin system maybe. But i always integrate with my gamemode, so that's why.
__________________

Retired from SA-MP


Gammix is offline   Reply With Quote
Old 29/12/2016, 09:20 PM   #6
KokyZ
Big Clucker
 
KokyZ's Avatar
 
Join Date: Sep 2016
Location: In Others Mind
Posts: 59
Reputation: 0
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

hey dude, good job for a simple gamemode
but i have question about this
Quote:
inputtext[i] |= 0x20;
and its why did you use '|=' and please explain the usage of this '|' and why have you used it with '='
KokyZ is offline   Reply With Quote
Old 30/12/2016, 03:57 AM   #7
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,639
Reputation: 625
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Quote:
Originally Posted by KokyZ View Post
hey dude, good job for a simple gamemode
but i have question about this

and its why did you use '|=' and please explain the usage of this '|' and why have you used it with '='
https://www.tutorialspoint.com/cprog..._operators.htm

I used it to convert everything to lowercase, as security answers are not case sensitive.
0x20 is equal to a ' ' (space), so "|=" sets the character to a lowercase if its in upper.
__________________

Retired from SA-MP


Gammix is offline   Reply With Quote
Old 30/12/2016, 06:22 AM   #8
TheMaskedGamer
Little Clucker
 
TheMaskedGamer's Avatar
 
Join Date: Jun 2016
Location: Why so curious about that?
Posts: 46
Reputation: 17
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Great man :O
__________________
^_^
TheMaskedGamer is offline   Reply With Quote
Old 30/12/2016, 12:41 PM   #9
SilverGaming
Banned
 
Join Date: Nov 2016
Location: Rendirse Jamaz
Posts: 267
Reputation: 16
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Anyone have register system =)?, great joob man
SilverGaming is offline   Reply With Quote
Old 04/01/2017, 10:15 AM   #10
bogushas
Big Clucker
 
bogushas's Avatar
 
Join Date: Sep 2012
Posts: 113
Reputation: 2
Default Re: [MySQL/SQLite] Advance Login & Register System (base script)

Is there gonna be the mysql version as u mentioned Gammix?
bogushas is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable Register/Login system in a script Sunehildeep Scripting Help 9 03/08/2016 02:57 PM
I am getting a mysql register and login script and im getting a error kingcrome Scripting Help 1 28/10/2013 10:27 PM
[FS] SQLite Register/Login system Hardwell Salonul Scripturilor 2 03/09/2013 10:30 AM
[FS] SQLite Register/Login system Hardwell Romānă/Romanian 4 31/10/2012 09:11 PM


All times are GMT. The time now is 02:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.