25.10.2012, 06:36
(
Последний раз редактировалось Danyal; 25.10.2012 в 11:14.
Причина: PROBLEM SOLVED
)
below are my dialog on register and login but my problem is that register password donot meet login password.
it shows i have enter a wrong password
here is on register output file
PROBLEM SOLVED BY UPDATING YSI PACKAGE THX TO *****
it shows i have enter a wrong password
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch( dialogid ) { case DIALOG_REGISTER: { switch( response ) { case 0: Kick( playerid ); case 1: { if( strlen( inputtext ) < 4 || strlen( inputtext ) > 16 ) return Register, SendClientMessage( playerid, COLOR_GREEN, "Invalid amount of characters"); new INI:pFile = INI_Open(pPath(playerid)), pBuffer[129], RegisterString[128]; WP_Hash(pBuffer, sizeof(pBuffer), inputtext); INI_SetTag (pFile, "data"); INI_WriteBool (pFile, "Logged", true); INI_WriteBool (pFile, "Banned", false); INI_WriteString (pFile, "Password", pBuffer); INI_WriteInt (pFile, "Admin_level", 0); INI_WriteInt (pFile, "Vip_level", 0); INI_WriteInt (pFile, "Money", STARTMONEY); INI_WriteInt (pFile, "Score", 0); INI_WriteInt (pFile, "Wanted_level", 0); INI_Close(pFile); format( RegisterString, sizeof RegisterString, "Thank you for registering %s! Your password is: %s", GetName(playerid), inputtext ); SendClientMessage( playerid, COLOR_BLUE, RegisterString ); GivePlayerMoney( playerid, STARTMONEY ); INI_ParseFile(pPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); } } return 1; } case DIALOG_LOGIN: { switch( response ) { case 0: Kick( playerid ); case 1: { new pBuffer[129], LoginMessage[128]; WP_Hash(pBuffer, sizeof(pBuffer), inputtext); if( !strcmp( PlayerInfo[playerid][pPassword], pBuffer, false ) ) { SetPlayerWantedLevel( playerid, PlayerInfo[playerid][pWanted] ); SetPlayerScore( playerid, PlayerInfo[playerid][pScore] ); GivePlayerMoney( playerid, PlayerInfo[playerid][pMoney] ); format( LoginMessage, sizeof LoginMessage, "Welcome back %s. | Admin level: %i | Vip level: %i |", GetName(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pVip] ); SendClientMessage( playerid, COLOR_BLUE, LoginMessage ); return 0; } else { pWarning[playerid]++; switch( pWarning[playerid] ) { case 1: SendClientMessage( playerid, COLOR_RED, "Wrong password, please try again. | Warnings: 1/3 |" ), Login; case 2: SendClientMessage( playerid, COLOR_RED, "Wrong password, please try again. | Warnings: 2/3 |" ), Login; case 3: SendClientMessage( playerid, COLOR_RED, "Wrong password, please try again. | Warnings: 3/3 |" ), Login; case 4: SendClientMessage( playerid, COLOR_RED, "Wrong password, therefor you got kicked from the server"), Kick( playerid ); } return 0; } } } return 1; } } return 0; }
Код:
[data] Logged = false Banned = false Password = FD9D94340DBD72C11B37EBB0D2A19B4D05E00FD78E4E2CE8923B9EA3A54E900DF181CFB112A8A73228D1F3551680E2AD9701A4FCFB248FA7FA77B95180628BB Admin_level = 0 Vip_level = 0 Money = 50000 Score = 0 Wanted_level = 0