OnPlayerLogin(playerid, password[])
{
new
hashPassword[129],
uFile[35];
format(uFile, 35, "%s.ini", PlayerName(playerid));
INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
WP_Hash(hashPassword, 129, password);
if(PlayerInfo[playerid][pBanned] == 1)
{
new banreason = PlayerInfo[playerid][pBanReason];
new string[128];
format(string, sizeof(string), "%s", banreason);
SendClientMessage(playerid, COLOR_LIGHTRED, "This account has been banned:");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
Kick(playerid);
return 0;
}
if(WP_Hash(hashPassword, 129, password) == PlayerInfo[playerid][pPassword])
{
SendClientMessage(playerid, COLOR_ORANGE, "You've logged into Los Santos Gang Wars!");
SetPVarInt(playerid, "Logged", 1);
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, "Error: wrong password entered, you've been kicked.");
Kick(playerid);
}
return 1;
}
if(WP_Hash(inputtext) == PlayerInfo[playerid][pPassword])
try this Edit wait thats for udb_hash not sure if its the same let do do a bit of research... Although if the abouve works let me know |
warning 202: number of arguments does not match definition warning 202: number of arguments does not match definition
OnPlayerRegister(playerid, password[])
{
new
hashPassword[129],
uFile[35];
format(uFile, 35, "%s.ini", PlayerName(playerid));
new
INI:playerFile = INI_Open(uFile);
WP_Hash(hashPassword, 129, password);
INI_WriteString(playerFile, "Password", hashPassword);
INI_WriteInt(playerFile, "Admin", 0);
INI_WriteInt(playerFile, "VIP", 0);
INI_WriteInt(playerFile, "Money", 500);
INI_WriteInt(playerFile, "Score", 0);
INI_WriteInt(playerFile, "Kills", 0);
INI_WriteInt(playerFile, "Deaths", 0);
INI_WriteInt(playerFile, "Online", 0);
INI_WriteInt(playerFile, "Banned", 0);
INI_WriteString(playerFile, "BanReason", PlayerInfo[playerid][pBanReason]);
INI_Close(playerFile);
SetPVarInt(playerid, "Registered", 1);
SetPVarInt(playerid, "Logged", 1);
return 1;
}
stock udb_hash(buf[])
{
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
if(WP_Hash(hashPassword, 129, password) == PlayerInfo[playerid][pPassword])
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
WP_Hash(hashPassword, 129, password);
INI_WriteString(playerFile, "Password", hashPassword);
INI_WriteInt(File,"Password",udb_hash(inputtext));
Right this might be a bit annoying for you but i dont have a clue what WP_Hash is so i cant really help but i may be able to help if you change your stock to udb_hash
If you are willing to do this replace the WP_Hash stock with pawn Код:
this pawn Код:
pawn Код:
pawn Код:
pawn Код:
also ****** has his own tutorial? or you can wait for somone else to reply... (who understands WP_Hash) also i found a better tutorial for you if this helps https://sampforum.blast.hk/showthread.php?tid=273088 EDIT: Youve replyed to this tutorial... im guessing this isnt the one you used or is it? |
I never used that tutorial nope, I tried what you told me to do, then tried the tutorial, it still didn't work. I'll have to re-do my registration system, then I'll let you know, thanks
|
Just Get yourself Another Login Register System...
I'll Help you with diractions... This is The Bestest Login Register System i ever seen: Login, Register, Rank |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if(response)
{
new
strText[179];
if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35)
{
new
uFile[35];
format(uFile, 35, "%s.ini", PlayerName(playerid));
new
INI:playerFile = INI_Open(uFile);
INI_WriteInt(playerFile, "Password",udb_hash(inputtext));
INI_WriteInt(playerFile, "Admin", 0);
INI_WriteInt(playerFile, "VIP", 0);
INI_WriteInt(playerFile, "Money", 500);
INI_WriteInt(playerFile, "Score", 0);
INI_WriteInt(playerFile, "Kills", 0);
INI_WriteInt(playerFile, "Deaths", 0);
INI_WriteInt(playerFile, "Online", 0);
INI_WriteInt(playerFile, "Banned", 0);
INI_WriteString(playerFile, "BanReason", PlayerInfo[playerid][pBanReason]);
INI_Close(playerFile);
SetPVarInt(playerid, "Registered", 1);
SetPVarInt(playerid, "Logged", 1);
format(strText, 125, "You have registered with name {FFFFFF}'%s' {FFFF00}and password {FFFFFF}'%s'{FFFF00}, you are automatic logged in!", GetName(playerid), inputtext);
SendClientMessage(playerid, COLOR_VAGOS, strText);
}
else
{
new registermsg[128];
format(registermsg, sizeof(registermsg), "Welcome to Los Santos Gang Wars.\n\nAccount Name: %s\nThat account is not registered, type your password below to register!", PlayerName(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register for - Los Santos Gang Wars, string", registermsg, "Register", "Exit");
}
}
else Kick(playerid);
}
case DIALOG_LOGIN:
{
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
{
OnPlayerLogin(playerid);
}
else
{
new loginmsg[128];
format(loginmsg, sizeof(loginmsg), "Welcome back to Los Santos Gang Wars!\n\nAccount Name: %s\nThat account is registered, type your password in to return to war.", PlayerName(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login to - Los Santos Gang Wars", loginmsg, "Login", "Exit");
}
}
else Kick(playerid);
}
}
return 1;
}
OnPlayerLogin(playerid)
{
if(PlayerInfo[playerid][pBanned] == 1)
{
new banreason = PlayerInfo[playerid][pBanReason];
new string[128];
format(string, sizeof(string), "%s", banreason);
SendClientMessage(playerid, COLOR_LIGHTRED, "This account has been banned:");
SendClientMessage(playerid, COLOR_LIGHTRED, string);
Kick(playerid);
return 0;
}
SendClientMessage(playerid, COLOR_ORANGE, "Welcome back to Los Santos Gang Wars!");
return 1;
}
stock udb_hash(buf[]) {
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) % 65521;
s2 = (s2 + s1) % 65521;
}
return (s2 << 16) + s1;
}
if(!INI_Exists(strText))
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Los Santos Gang Wars", registermsg, "Register", "Exit");
}
else
{
new
uFile[35];
format(uFile, 35, "%s.ini", PlayerName(playerid));
INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Los Santos Gang Wars", loginmsg, "Login", "Exit");
}
new strText[179];
if(strlen(inputtext) >= 4 && strlen(inputtext) <= 35)