SA-MP Forums Archive
Register problem - 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: Register problem (/showthread.php?tid=554825)



Register problem - Glossy42O - 05.01.2015

I got register system but the problem that.. if i put wrong pass it still lets me go in plus even if it says you have to put 6 characters longer it says after i click okay or put 1 character it says "Successfully logged in"

But why logged in? suppose to be successfully registered.. and it doesn't say the same messge about 6 characters.. which code to show ?


Re: Register problem - SilentSoul - 05.01.2015

Show your codes, we can't help you without seeing it.


AW: Register problem - Sascha - 05.01.2015

I suppose you did not create that script on your own, as you don't even know which code would be necessarry to show...
Therefor I suggest contacting the person that created the script for you. He/She should know.


Re: Register problem - Glossy42O - 05.01.2015

I did create it. but HOW can i know which code to show ... ._.

Seriously? wow i didn't knew which code to show means i didn't create the script.. pfft


Re: Register problem - SilentSoul - 05.01.2015

Quote:
Originally Posted by Stuun23
Посмотреть сообщение
I did create it. but HOW can i know which code to show ... ._.

Seriously? wow i didn't knew which code to show means i didn't create the script.. pfft
Show your OnDialogResponse register/login codes if you are using them with dialogs. also show us your queries, or if you're using commands for register/ login show them.


AW: Register problem - Flori - 05.01.2015

So, when you press okey, then it seems to be related with dialogresponse. Maybe you compare the strings false.


Re: Register problem - Glossy42O - 05.01.2015

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
          if(
dialogid == dregister)
          {
            if(!
response) return Kick(playerid);
            if(
response)
            {
               if(
strlen(inputtext) < 6) return ShowPlayerDialog(playeriddlogin,DIALOG_STYLE_INPUT"Register""Your password has to be atleast 6 characters long!""Register","bb");
               new 
hashpass[129];
               
WP_Hash(hashpass,sizeof(hashpass),inputtext);
               new 
INI:File INI_Open(Path(playerid));
               
INI_SetTag(File,"Player Information");
               
INI_WriteString(File,"Password",hashpass);
               
INI_WriteInt(File,"AdminLevel",0);
               
INI_WriteInt(File,"VIP",0);
               
INI_WriteInt(File,"Cash",0);
               
INI_WriteInt(File,"Score",0);
               
INI_WriteInt(File,"Kills",0);
               
INI_WriteInt(File,"Deaths",0);
               
INI_Close(File);
               
SendClientMessage(playerid,-1"{00CC00}[System]: {FFFFFF}You have successfully registered!");
               return 
1;
             }
           }
           if(
dialogid == dlogin)
           {
              if(!
response) return Kick(playerid);
              if(
response)
           {
             new 
hashpass[129];
             
WP_Hash(hashpass,sizeof(hashpass),inputtext);
             if(!
strcmp(hashpasspInfo[playerid][Pass], false))
            {
               
INI_ParseFile(Path(playerid),"loaduser_%s",.bExtra true,.extra playerid);
               
SetPlayerScore(playerid,pInfo[playerid][Score]);
               
GivePlayerMoney(playerid,pInfo[playerid][Cash]);
               
pInfo[playerid][Deaths]++;
               
SendClientMessage(playerid,-1"{00CC00}[System]: {FFFFFF}You have successfully logged in!!");
             }
             else
             {
               
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT"Wrong pass""{FF0000}The password you have entered was incorrect, please try again.","Login","Cya");
             }
             return 
1;
         }
      }
           return 
1;




AW: Register problem - Flori - 05.01.2015

return 0 at the end if you use also other filterscript with dialogresponse.


Re: Register problem - Glossy42O - 05.01.2015

same.


AW: Re: Register problem - Flori - 05.01.2015

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
          if(dialogid == dregister)
          {
            if(!response) return Kick(playerid);
            if(response)
            {
               if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, dregister,DIALOG_STYLE_INPUT, "Register", "Your password has to be atleast 6 characters long!", "Register","bb");
               new hashpass[129];
               WP_Hash(hashpass,sizeof(hashpass),inputtext);
               new INI:File = INI_Open(Path(playerid));
               INI_SetTag(File,"Player Information");
               INI_WriteString(File,"Password",hashpass);
               INI_WriteInt(File,"AdminLevel",0);
               INI_WriteInt(File,"VIP",0);
               INI_WriteInt(File,"Cash",0);
               INI_WriteInt(File,"Score",0);
               INI_WriteInt(File,"Kills",0);
               INI_WriteInt(File,"Deaths",0);
               INI_Close(File);
               SendClientMessage(playerid,-1, "{00CC00}[System]: {FFFFFF}You have successfully registered!");
               return 1;
             }
           }
           if(dialogid == dlogin)
           {
              if(!response) return Kick(playerid);
              if(response)
           {
             new hashpass[129];
             WP_Hash(hashpass,sizeof(hashpass),inputtext);
             if(!strcmp(hashpass, pInfo[playerid][Pass], false))
            {
               INI_ParseFile(Path(playerid),"loaduser_%s",.bExtra = true,.extra = playerid);
               SetPlayerScore(playerid,pInfo[playerid][Score]);
               GivePlayerMoney(playerid,pInfo[playerid][Cash]);
               pInfo[playerid][Deaths]++;
               SendClientMessage(playerid,-1, "{00CC00}[System]: {FFFFFF}You have successfully logged in!!");
             }
             else
             {
               ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT, "Wrong pass", "{FF0000}The password you have entered was incorrect, please try again.","Login","Cya");
             }
             return 1;
         }
      }
           return 1;
}

Try..