WP_Hash
#1

Native:
PHP код:
native WP_Hash(buffer[], len, const str[]); 
y_ini:
PHP код:
WP_Hash(HashPasssizeof(HashPass), inputtext);
new 
INI:ini INI_Open(pFile(playerid));
INI_WriteString(ini"Password"HashPass);
INI_Close(ini); 
Player File:
PHP код:
Password 
It doesn't get inputtext and writing in in the player file, why?
Reply
#2

bump
Reply
#3

Make sure "HashPass" variable length is 129
Reply
#4

Quote:
Originally Posted by X337
Посмотреть сообщение
Make sure "HashPass" variable length is 129
it is, maybe i didnt install the Whirlpool good?
I putted it the dll file at my plugns and added "whirlpool.dll" to my plungs label at my server.cfg
Reply
#5

BUMP
Reply
#6

C'MON PLEASE RESPOND!!! BUMPPP
IM WAITING MORE THAN A WEEK FOR AN ANSWER
Reply
#7

Whirlpool gives Hashes that are 128 characters long as far as i know

So it should work
Reply
#8

Otherwise, show us some more of your Login/Register scripts.
Reply
#9

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Otherwise, show us some more of your Login/Register scripts.
PHP код:
public OnPlayerConnect(playerid)
{
    
INI_ParseFile(pFile(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
    
SetPlayerPos(playerid1742.9839,-1862.0048,13.5768);
    
SetPlayerFacingAngle(playerid,0);
    
SetPlayerCameraPos(playerid1742.8409,-1843.0232,18.6594);
    
SetPlayerCameraLookAt(playerid1742.9839,-1862.0048,13.5768);
    
GameTextForPlayer(playerid"Loading Database"20006);
    
SetTimerEx("LoginDelay"1500false"i"playerid);
    return 
1;

PHP код:
public LoginDelay(playerid){
PlayAudioStreamForPlayer(playerid,"http://k003.kiwi6.com/hotlink/5uwkh58nn7/My_Nigga.mp3");
for(new 
0100i++){
MSG(playerid,C_WHITE,"");}
MSG(playerid,C_GREEN,"[Server] {77ff77}Welcome to Gangsta Regeneration Roleplay!");
MSG(playerid,C_YELLOW,"Hello there! I notice that many people joining to this server while i'm afk so if you want to talk to me please add me to my skype: LirboXD");
SetPlayerPos(playerid1742.9839,-1862.0048,13.5768);
SetPlayerFacingAngle(playerid,0);
SetPlayerCameraPos(playerid1742.8409,-1843.0232,18.6594);
SetPlayerCameraLookAt(playerid1742.9839,-1862.0048,13.5768);
SetPlayerSkin(playerid,DB[playerid][Skin]);
if(!
fexist(pFile(playerid))) return DLG(playerid,0,DIALOG_STYLE_PASSWORD,"Registration","{d6d681}Hello there and welcome to Gangsta Regeneration Roleplay!\nPlease enter a password to register to our server.\n{ff5555}NOTE: {ff7777}We recommend you to use a password that you would remember.","Register","");
else 
DLG(playerid,1,DIALOG_STYLE_PASSWORD,"Login","{d6d681}Hello there and welcome back to Gangsta Regeneration Roleplay!\nPlease enter your current password to get access to your account.","Login","");
return 
1;} 
PHP код:
// Register Dialog
    
if(dialogid == 0){
    if(!
response) return Kick(playerid);
    if(
strlen(inputtext)<|| strlen(inputtext)>20)    {
    
MSG(playerid,C_RED,"[ERROR] {ff7777}The password must be between 6-20 characters!");
    
DLG(playerid,0,DIALOG_STYLE_PASSWORD,"Registration","{d6d681}Hello there and welcome to Gangsta Regeneration Roleplay!\nPlease enter a password to register to our server.\n{ff5555}NOTE: {ff7777}We recommend you to use a password that you would remember.","Register","");
    return 
1;}
    if(
fexist(banFile(playerid))){
    
MSG(playerid,C_GRAY,"=====================================================================");
    
MSG(playerid,C_RED,"[BAN] {ff7777}This character is banned.");
    
format(String,sizeof(String),"Your Name: {7777ff}%s",GetName(playerid));
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Admin: {7777ff}%s",BanDB[playerid][Admin]);
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Reason: {7777ff}%s",BanDB[playerid][Reason]);
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Time: {7777ff}%i:%i:%i",BanDB[playerid][Hour],BanDB[playerid][Minute],BanDB[playerid][Second]);
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Date: {7777ff}%i/%i/%i",BanDB[playerid][Day],BanDB[playerid][Month],BanDB[playerid][Year]);
    
MSG(playerid,C_BLUE,String);
    
MSG(playerid,C_GREEN,"[ScreenShot] {77ff77}If you think this ban is wrong you may take a screenshot (F8) and appeal at our forums.");
    
MSG(playerid,C_GRAY,"=====================================================================");
    
GameTextForPlayer(playerid"~R~Banned"999990);
    
SetTimerEx("BanDealy"1000false"i"playerid);
    return 
1;}
    if(
fexist(banipFile(playerid))){
    
MSG(playerid,C_GRAY,"=====================================================================");
    
MSG(playerid,C_RED,"[BAN] {ff7777}This IP address is banned.");
    
format(String,sizeof(String),"Your Name: {7777ff}%s",GetName(playerid));
    
MSG(playerid,C_BLUE,String);
    
GetPlayerIp(playerid,PIP,sizeof(PIP));
    
format(String,sizeof(String),"Your IP: {7777ff}%s",PIP);
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Admin: {7777ff}%s",BanipDB[playerid][Admin]);
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Reason: {7777ff}%s",BanipDB[playerid][Reason]);
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Time: {7777ff}%i:%i:%i",BanipDB[playerid][Hour],BanipDB[playerid][Minute],BanDB[playerid][Second]);
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Date: {7777ff}%i/%i/%i",BanipDB[playerid][Day],BanipDB[playerid][Month],BanipDB[playerid][Year]);
    
MSG(playerid,C_BLUE,String);
    
MSG(playerid,C_GREEN,"[ScreenShot] {77ff77}If you think this ban is wrong you may take a screenshot (F8) and appeal at our forums.");
    
MSG(playerid,C_GRAY,"=====================================================================");
    
GameTextForPlayer(playerid"~R~Banned"999990);
    
SetTimerEx("BanipDelay"1000false"i"playerid);
    return 
1;}
    
MSG(playerid,C_GRAY,"=====================================================================");
    
format(String,sizeof(String),"Nickname: {7777ff}%s.",GetName(playerid));
    
MSG(playerid,C_BLUE,String);
    
format(String,sizeof(String),"Password: {7777ff}%s.",inputtext);
    
MSG(playerid,C_BLUE,String);
    
GetPlayerIp(playerid,PIP,sizeof(PIP));
    
format(String,sizeof(String),"IP Address: {7777ff}%s.",PIP);
    
MSG(playerid,C_BLUE,String);
    
MSG(playerid,C_GRAY,"[TIP] We recommend you to take a screenshot (F8) incase you will forget your password.");
    
MSG(playerid,C_GRAY,"[TIP] You can change your password anytime by typing /changepassword.");
    
MSG(playerid,C_GRAY,"=====================================================================");
    
Logged[playerid] = true;
    
DLG(playerid,3,DIALOG_STYLE_LIST,"Gender","{e8ba74}White Male\n{e8ba74}White Female\n{a66b14}Black Male\n{a66b14}Black Female","Choose","");
    
MSG(playerid,C_RED,"[WARNING] {ff7777}If you won't choose a gender it would choose for you automatically for White Male.");
    
SpawnPlayer(playerid);
    
GetPlayerIp(playerid,PIP,sizeof(PIP));
    
DB[playerid][RegisterIP]=strval(PIP);
    
DB[playerid][LastLoginIP]=strval(PIP);
    
DB[playerid][LogCount]=DB[playerid][LogCount]+1;
    new 
INI:ini INI_Open(pFile(playerid));
    new 
HashPass[129];
    
WP_Hash(HashPasssizeof(HashPass), inputtext);
    
INI_WriteString(ini"Password"HashPass);
    
INI_Close(ini);
    
DB[playerid][Level]=1;
    
DB[playerid][RPointsMax]=4;
    
DB[playerid][Money]=200;
    
DB[playerid][Bank]=500;
    
DB[playerid][Gender]=strval("White Male");
    
DB[playerid][Skin]=60;
    
DB[playerid][Accent]=strval("None");
    
DB[playerid][Faction]=strval("Civilian");
    
DB[playerid][Rank]=strval("Civilian");
    
DB[playerid][FLevel]=1;
    
DB[playerid][InterestsRate]=0.0025;
    
DB[playerid][Job]=strval("Unemployed");
    
DB[playerid][Payment]=150;
    
DB[playerid][KDR]=1.00;
    
SavePlayerFile(playerid);
    return 
1;} 
Reply
#10

why dont you download a script that has whirlpool and works and then just compare it
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)