Password - 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: Password (
/showthread.php?tid=542303)
Password -
Norhy - 18.10.2014
Hey, I'm trying to make a register system, however, no matter what I enter, the password is always correct.
PHP код:
if(!strcmp(data, cmdtext[5], false)) return SendClientMessage(playerid, -1, "{FFFFFF}SERVER: The password is not correct.");
I'm using the default command processor.
AW: Password -
Nero_3D - 18.10.2014
strcmp return 0 if the string match ->
https://sampwiki.blast.hk/wiki/Strcmp
Re: Password -
Abagail - 18.10.2014
What is the data variable? Can you show the code for processing the user's login input?
Re: Password -
Rudy_ - 18.10.2014
pawn Код:
if(!strcmp(data, cmdtext[5], true)) return SendClientMessage(playerid, -1, "{FFFFFF}SERVER: The password is not correct.");
try this
Re: Password -
Norhy - 18.10.2014
Rudy, it doesn't work.
PHP код:
if(fexist(string))
{
new File:LogFile = fopen(string, io_read);
if(!LogFile) printf("error: %s (io_read)", string);
fread(LogFile, data, sizeof(data));
if(!strcmp(data, cmdtext[5], true)) return SendClientMessage(playerid, -1, "{FFFFFF}SERVER: The password is not correct.");
else
{
SetPVarString(playerid, "password", cmdtext[5]);
SendClientMessage(playerid, -1, "{FFFFFF}SERVER: You have been successfully logged in.");
Log[playerid] = true;
}
fclose(LogFile);
}
This is the login. The register system works.