05.07.2014, 14:36
rit_Hasher ©
Introduction :-
"rit_Hash" function hashes string/text/passwords to numerical digits, and it
provides security to texts/passwords from being cracked. Decrypting hashed
strings, encrypted by this function is difficult.Note:Though it returns a string value.
It is only available for "pawno" scripting language . Hence it is not a plugin.
You can freely use this include with these :INI: system while creating a Register
Login system for you server:-
1: Y_INI - "******" - https://github.com/Y-Less
2: DINI - "DracoBlue"
3:MySQL (Most Probably)
Syntax :-
pawn Код:
rit_Hash(buffer[]);
Example :-
Password Input: "rittik"
pawn Код:
case DIALOG_REGISTER: //From Kush's Tutorial
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Password",rit_Hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strcmp(rit_Hash(inputtext),PlayerInfo[playerid][pPass],false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
Код:
Output : 861498793485876612876612793485808599
v1.R
Bugs Known :-
None. If you get any bugs in future please contact me at
forum.sa-mp.com
or
www.github.com/RittikVerma
Contact :-
Private Message
Credits :-
Sa-Mp Team
Download :-
rit_Hasher Download
Note: This is my first hasher which I created/developed so please don't be too harsh on me.