What is wrong? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What is wrong? (
/showthread.php?tid=332672)
What is wrong? -
nmader - 08.04.2012
Alright, so this is my dialog for my login screen, but I cannot seem to get it to work properly, it says every password is invalid.
pawn Код:
if(strlen(inputtext) >= 1)
{
INI_ParseFile(UserPath(playerid), "LoadUserData_%s", .bExtra = true, .extra = playerid);
if(strlen(inputtext) == pInfo[playerid][Password])
{
pInfo[playerid][Authenticated] = 1;
SpawnPlayer(playerid);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "ERROR: Invalid Password!");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login", "Login", "Login", "Cancel");
return 1;
}
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "ERROR: No password was entered!");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "Login", "Login", "Login", "Cancel");
return 1;
}
Re: What is wrong? -
Vince - 09.04.2012
Learn what a function does first, before attempting to create a script with it.
https://sampwiki.blast.hk/wiki/Strlen
https://sampwiki.blast.hk/wiki/Strcmp
Re: What is wrong? -
mincer1667 - 09.04.2012
INI_ParseFile(UserPath(playerid), "LoadUserData_%s", .bExtra = true, .extra = playerid);
do you load pInfo[playerid][Password] when parsing?