[MySQL] Advanced Registration System
#1

If you don't know me yet, here's a quote from my old release located at: http://forum.sa-mp.com/index.php?topic=157771.0'
Quote:

Some of you have seen me on the forums so far, i'm pretty much new to scripting, I'm a c++ coder and a PHP coder, so PAWN is easier for me atm. I noticed people were releasing scripts here, and I thought, why not make something that isn't in SA-MP, like the teargas feature, so I simply, went into Pawno, and did my thing.

Recently, I've been studying more of PAWN and the functions available at http://www.wiki.sa-mp.com. I came across a mysql plugin and was interested in using it for a future release. So I made a advanced registration system. Some features are found below:
  • 100% MySQL.
  • Easily editable - You can edit the messages easily and mysql info.
  • Toggle Autologin - You can toggle autologin on, or off.
  • Force login - You are able to toggle force login on or off, ( used for RP server )
  • Force login dialogs
  • Easy to edit registration and login system.
  • Saves: money, health, armour, adminlevel, bank

In my opinion, I think whoever that is interested into this, that you use this as a base registration system, because of the adminlevel and bank etc. The codes below is a example how to edit the register and login messages. This is a premade example that's already included.

pawn Code:
function OnPlayerLogin(playerid) {
  // In this function you can make a user forcespawn. This is called after someone logged in..
      GivePlayerMoney(playerid, PlayerAccount[playerid][Money]);
      SetPlayerHealth(playerid, PlayerAccount[playerid][Health]);
  SetPlayerHealth(playerid, PlayerAccount[playerid][Armour]);
      AccountData[playerid][Logged] = true;
}
pawn Code:
function OnPlayerRegister(playerid) {
  // In this function you can make a user forcespawn. This is called after someone registered.
 
  AccountData[playerid][Account] = true;
  #if defined Force_Login
      {
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Enter your password below:","Login","Cancel"); }
      #endif
}
I know alot of users will have trouble with the query installation for PHPMyAdmin or something similar, the code is below, just simply insert it into your database.

Code:
CREATE TABLE IF NOT EXISTS `YOUR TABLE NAME!` (
 `Name` text NOT NULL,
 `Password` text NOT NULL,
 `IP` text NOT NULL,
 `Money` int(20) NOT NULL,
 `AdminLevel` int(20) NOT NULL,
 `Health` float NOT NULL,
 `Armour` float NOT NULL,
 `Bank` int(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I would like to give some credits/props to some people who helped me make this.

Seif: The function define.
pawn Code:
#define function%0(%1) stock%0(%1)
ZeeX Zcmd.

If you get some errors, for example:
pawn Code:
fatal error 100: cannot read from file: "zcmd"
or something similar the download includes are below also.

MySQL include: http://forum.sa-mp.com/index.php?topic=79352.0
Zcmd include: http://forum.sa-mp.com/index.php?topic=116240.0
Script download: http://pastebin.com/eT0xTThB

Enjoy :P
Reply


Messages In This Thread
[MySQL] Advanced Registration System - by Carlton - 13.03.2010, 01:12
Re: [MySQL] Advanced Registration System - by Carlton - 13.03.2010, 11:29
Re: [MySQL] Advanced Registration System - by [MWR]Blood - 13.03.2010, 11:46
Re: [MySQL] Advanced Registration System - by Calgon - 13.03.2010, 16:32
Re: [MySQL] Advanced Registration System - by Joe Staff - 13.03.2010, 16:42
Re: [MySQL] Advanced Registration System - by Carlton - 13.03.2010, 19:23
Re: [MySQL] Advanced Registration System - by Kyosaur - 15.03.2010, 02:38
Re: [MySQL] Advanced Registration System - by [03]Garsino - 18.03.2010, 16:35
Re: [MySQL] Advanced Registration System - by Carlton - 18.03.2010, 19:38
Re: [MySQL] Advanced Registration System - by acade - 20.03.2010, 00:15

Forum Jump:


Users browsing this thread: 2 Guest(s)