Password
#1

Hey, I'm trying to make a register system, however, no matter what I enter, the password is always correct.

PHP код:
if(!strcmp(datacmdtext[5], false)) return SendClientMessage(playerid, -1"{FFFFFF}SERVER: The password is not correct."); 
I'm using the default command processor.
Reply
#2

strcmp return 0 if the string match -> https://sampwiki.blast.hk/wiki/Strcmp
Reply
#3

What is the data variable? Can you show the code for processing the user's login input?
Reply
#4

pawn Код:
if(!strcmp(data, cmdtext[5], true)) return SendClientMessage(playerid, -1, "{FFFFFF}SERVER: The password is not correct.");
try this
Reply
#5

Rudy, it doesn't work.

PHP код:
        if(fexist(string))
        {
            new 
File:LogFile fopen(stringio_read);
            if(!
LogFileprintf("error: %s (io_read)"string);
            
fread(LogFiledatasizeof(data));
            if(!
strcmp(datacmdtext[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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)