Line 143: new hashed_password[129];
Line 144: WP_Hash(hashed_password, sizeof(hashed_password), inputtext);
Line 145: djSetInt(file, "Password", hashed_password);
C:\Users\Simon\Desktop\samp server\gamemodes\rpg.pwn(145) : error 035: argument type mismatch (argument 3) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
That function just sets an integer into a json file.
I am using djson to save user data. |
The output of a hashed password its not an integer its an string.
So switch to the other functiont that sets strings instead of integers. |
The code part looks like this:
pawn Code:
|
if(dialogid == 2)
{
if(!response)
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, COLOR_SYSTEMRED, "( ! ) You must log in to play on this server. Please come again soon");
Kick(playerid);
gPlayerLogged[playerid] = 0;
}
new tmp, hashed_password[129];
tmp = dj(file, "Password");
WP_Hash(hashed_password, sizeof(hashed_password), inputtext);
if(hashed_password != tmp)
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{FFFF00}Hopes Hills RPG Account", "{AF0000}Incorrect Password!\n{FFFFFF}Enter your Password", "Login", "Quit");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "( ! ) You have successfully Logged In!");
GivePlayerMoney(playerid, djInt(file, "Money"));
PlayerInfo[playerid][pBanned] = djInt(file, "Banned");
LoadUserData(playerid);
gPlayerLogged[playerid] = 1;
OnceLogged[playerid] = 1;
}
C:\Users\Simon\Desktop\samp server\gamemodes\rpg.pwn(175) : error 006: must be assigned to an array C:\Users\Simon\Desktop\samp server\gamemodes\rpg.pwn(178) : error 033: array must be indexed (variable "hashed_password") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.