SA-MP Forums Archive
[Help] Dialog Login System - 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: [Help] Dialog Login System (/showthread.php?tid=294492)



[Help] Dialog Login System - mikiii18 - 01.11.2011

Hello

I'm editing the Carlitos roleplay. For the server to get a better look, decided it would be for the login dialog.

However, if a person leave the password field blank and click in the Enter key, he/she logs-in.

Help me please.

I'll leave here the code:

Код:
	    new PassData[256];
	    new keytmp[256], valtmp[256];
	    fread( UserFile , PassData , sizeof( PassData ) );
	    keytmp = ini_GetKey( PassData );
	    if( strcmp( keytmp , "Key" , true ) == 0 )
		{
			valtmp = ini_GetValue( PassData );
			strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
		}
		if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
                {
                  // I donґt put in hear this code, but it will get the player infos

Thank you very much.


Re: [Help] Dialog Login System - Sascha - 01.11.2011

you can add something like this before that code (underneath the response check)
pawn Код:
if(!strlen(inputtext))
{
  //show dialog again and send message to enter the correct pass
}