10.04.2010, 22:47
[INC] ErroR's new generation user system
Saves
Money
Score
Team*
Time*
Fight Style and Skills*
Drunk Level*
Wanted Level*
Weapons*
Health and Armour*
Position
Skin*
* = Optional
And you can add your own entries...
Features
-Optional callbacks
OnPlayerLogged(playerid,username[]) //Called after the login.
OnPlayerRegistered(playerid,username[]) // Called after the register.
-Usergroup System
-Fully customizable
Now that's easy to add additional entries.
The only thing you need to do, to put the AddIntInfo/AddFloatInfo/AddStringInfo command.
Example:
-Improved Auto Login
- Automatically removes invalid entries
- Quickly makes the login. Does not require additional processing.
- IP addresses and user names are stored in autologin.ini.
-Skill saving
Skill saving, first time in ErroR's user system.
-GUI mode
0 = GUI off
1 = GUI before spawn
2 = GUI after spawn
-Customizable stats saving
If you set timerinterval to 0, stats saving timer will not work.
Functions
Photos & Videos
Installation
1- Put to the top
2- Put to the OnGameModeInit and configure
SetupUserSystem function:
Mode = If you set to 0, gui will not work. If you set to 1, gui will appear before spawn, 2= gui will appear after spawn
Default User Group = Default user group while players was registering. I suggest to type 0.
Min pass size = I suggest to type 4.
Failed login threshold = This option sets invalid login limit. I suggest to type 3.
SetupStatsSavingSystem function:
OnPlayerUpdate = If you set true, stats will be saved automaticly in onplayerupdate callback.
OnPlayerDisconnect = If you set true, stats will be saved automaticly in onplayerdisconnect callback.
OnPlayerStateChange = If you set true, stats will be saved automaticly in onplayerstatechage callback.
Timer Interval = If you enter a interval, stats will be saved automaticly with timer. If you set to 0, timer will not work.
Download V1.3
http://solidfiles.com/d/48f4/download/
[TUT]How to add additional entries in ErroR's registration system: http://forum.sa-mp.com/index.php?topic=171614.0
_________________________________________________
Sorry for my english
Saves
Money
Score
Team*
Time*
Fight Style and Skills*
Drunk Level*
Wanted Level*
Weapons*
Health and Armour*
Position
Skin*
* = Optional
And you can add your own entries...
Features
-Optional callbacks
OnPlayerLogged(playerid,username[]) //Called after the login.
OnPlayerRegistered(playerid,username[]) // Called after the register.
-Usergroup System
Quote:
SetupUserSystem(mode, defaultusergroup, minpasssize, savetime, saveteam, savefightandskill, savedrunk, savewanted, saveweapon, savehealth, saveskin, failedloginthreshold); GetMemberUsergroup(username[]); ChangeMemberUsergroup(username[],usergroup); |
Now that's easy to add additional entries.
The only thing you need to do, to put the AddIntInfo/AddFloatInfo/AddStringInfo command.
Example:
pawn Код:
public OnPlayerRegistered(playerid,username[])
{
new randphone = 1000 + random(8999);//minimum 1000 max 9999 //giving one at the start
AddIntInfo(username,"phone",randphone);
return 1;
}
- Automatically removes invalid entries
- Quickly makes the login. Does not require additional processing.
- IP addresses and user names are stored in autologin.ini.
pawn Код:
SetAutoLogin(username[],ip[]);
RemoveAutoLogin(ip[]);
CheckAutoLogin(ip[]);
Skill saving, first time in ErroR's user system.
Quote:
SetupUserSystem(mode, defaultusergroup, minpasssize, savetime, saveteam,savefightandskill, savedrunk, savewanted, saveweapon, savehealth, saveskin, failedloginthreshold) |
Quote:
SetupUserSystem(mode, defaultusergroup, minpasssize, savetime, saveteam, savefightandskill, savedrunk, savewanted, saveweapon, savehealth, saveskin, failedloginthreshold) |
1 = GUI before spawn
2 = GUI after spawn
-Customizable stats saving
Quote:
forward SetupStatsSavingSystem(boolnplayerupdate,booln playerdisconnect,boolnplayerstatechange,timerint erval); |
Functions
pawn Код:
//###########// CALLBACKS //###############//
forward OnPlayerLogged(playerid,username[]);
forward OnPlayerRegistered(playerid,username[]);
//###########// SETUP //#################//
forward SetupUserSystem(mode, defaultusergroup, minpasssize, savetime, saveteam, savefightandskill, savedrunk, savewanted, saveweapon, savehealth, saveskin, failedloginthreshold); //modes: 0:gui system off 1:gui before spawn, 2:gui after spawn
forward SetupStatsSavingSystem(bool:onplayerupdate,bool:onplayerdisconnect,bool:onplayerstatechange,timerinterval);
//##########// ADDITIONAL FIELDS //##############//
forward AddIntInfo(username[],key[],value);
forward AddFloatInfo(username[],key[],Float:value);
forward AddStringInfo(username[],key[],value[]);
//##########// USER ADD & DELETE //###############//
forward RegisterMember(username[],password[]);
forward RegisterMemberByPlayer(playerid, username[],password[], autologin);
forward DeleteMember(username[]);
//##########// LOGIN & LOGOUT //###############//
forward Login(playerid,username[]);
forward Logout(playerid,bool:showlogindialog);
//##########// AUTO LOGIN //###############//
forward SetAutoLogin(username[],ip[]);
forward RemoveAutoLogin(ip[]);
// CheckAutoLogin(ip[]);
//##########// GET INFO //###############//
forward GetMemberStatsInt(username[],statname[]);
// GetMemberStatsFloat(username[],statname[]);
// GetMemberStatsString(username[],statname[]);
forward GetMemberUsergroup(username[]);
// GetMemberEncryptedPassword(username[]);
forward GetMemberPlayerID(username[]);
// GetPlayerUsername(playerid);
forward IsPlayerLogged(playerid);
//##########// SET INFO //###############//
forward ChangeMemberName(oldname[],newname[]);
forward ChangeMemberPassword(username[],password[]);
forward ChangeMemberUsergroup(username[],usergroup);
forward SetMemberStatsInt(username[],statname[],value);
forward SetMemberStatsFloat(username[],statname[],Float:value);
forward SetMemberStatsString(username[],statname[],value[]);
Installation
1- Put to the top
pawn Код:
#include <usersystem>
pawn Код:
SetupUserSystem(mode, defaultusergroup, minpasssize, savetime, saveteam, savefightandskill, savedrunk, savewanted, saveweapon, savehealth, saveskin, failedloginthreshold); //modes: 0:gui system off 1:gui before spawn, 2:gui after spawn
SetupStatsSavingSystem(bool:onplayerupdate,bool:onplayerdisconnect,bool:onplayerstatechange,timerinterval);
Mode = If you set to 0, gui will not work. If you set to 1, gui will appear before spawn, 2= gui will appear after spawn
Default User Group = Default user group while players was registering. I suggest to type 0.
Min pass size = I suggest to type 4.
Failed login threshold = This option sets invalid login limit. I suggest to type 3.
SetupStatsSavingSystem function:
OnPlayerUpdate = If you set true, stats will be saved automaticly in onplayerupdate callback.
OnPlayerDisconnect = If you set true, stats will be saved automaticly in onplayerdisconnect callback.
OnPlayerStateChange = If you set true, stats will be saved automaticly in onplayerstatechage callback.
Timer Interval = If you enter a interval, stats will be saved automaticly with timer. If you set to 0, timer will not work.
Download V1.3
http://solidfiles.com/d/48f4/download/
[TUT]How to add additional entries in ErroR's registration system: http://forum.sa-mp.com/index.php?topic=171614.0
_________________________________________________
Sorry for my english