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



Login - Filbert - 08.07.2016

I made this command >
PHP код:
    if(dialogid == DIALOG_LOGIN)
    {
        if(!
response) return Kick(playerid);
        if (
response)
        {
            new 
hashpass[129];
            
WP_Hash(hashpass,sizeof(hashpass),inputtext);
            if(!
strcmp(hashpass,PlayerInfo[playerid][pass])){
                new 
dialogstr[256];
                new 
pame[MAX_PLAYER_NAME];
                
GetPlayerName(playeridpamesizeof(pame));
                if (
PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,red,"ACCOUNT: You are already logged in.");
                if (!
udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,red,"ACCOUNT: Account doesn't exist, please use '/register [password]'.");
                if (
strlen(inputtext)==0) return format(dialogstr,sizeof(dialogstr),"{FFFFFF}%s This nickname is registed please login:"pame), ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT"{FF0000}Login"dialogstr"Accept""Cancel");
                if (
udb_CheckLogin(PlayerName2(playerid),inputtext)){
                    new 
file[256], tmp3[100];
                       
format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(PlayerName2(playerid)) );
                       
GetPlayerIp(playerid,tmp3,100);
                       
dini_Set(file,"ip",tmp3);
                    
LoginPlayer(playerid);
                    
LoadPlayer(playerid);
                    
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                    if(
PlayerInfo[playerid][Level] > 0){
                        
format(string,sizeof(string),"|- You have Successfully Logged! | Level %d -|"PlayerInfo[playerid][Level] );
                        
SendClientMessage(playerid,green,string);
                        return 
SendClientMessage(playerid,green,"Welcome back to Super Gaming Community [3e]!");
                       } else return 
SendClientMessage(playerid,green,"|- You have Successfully logged! -|"), SendClientMessage(playerid,green,"Welcome back to Super Gaming Community [3e]!");
                }
                else
                {
                    
PlayerInfo[playerid][FailLogin]++;
                    
printf("LOGIN: %s has failed to login, Wrong password (%s) Attempt (%d)"PlayerName2(playerid), inputtextPlayerInfo[playerid][FailLogin] );
                    if(
PlayerInfo[playerid][FailLogin] == MAX_FAIL_LOGINS){
                        
format(stringsizeof(string), "%s has been kicked (Failed Logins)"PlayerName2(playerid) );
                        
SendClientMessageToAll(greystring);
                        print(string);
                        
Kick(playerid);
                    }
                    return 
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT"Password""WRONG Password, Try Again""Login""Cancel");
                 }
                else {
                    
Kick(playerid);
                }
            }
            return 
1;
        }
    } 
But I found this error >
Код:
D:\Data\Filbert\SA-MP Server\SGTDM~RP\Gamemodes\SGTDM~RP.pwn(24518) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I want to hash my password. Please help me in hashing password too...
Thanks


Re: Login - SyS - 08.07.2016

show us line 24518


Re: Login - Filbert - 08.07.2016

I don't know your mean


Re: Login - TaiRinsuru - 08.07.2016

Quote:
Originally Posted by Filbert
Посмотреть сообщение
I don't know your mean
he meant show your code in the line 24518 we might can help you


Re: Login - SyS - 08.07.2016

Quote:
Originally Posted by Filbert
Посмотреть сообщение
I don't know your mean
the line on which this error is showing please post it too you can look left side of pawn to check line number and post 24518 th line


Re: Login - Filbert - 08.07.2016

PHP код:
                else { 



Re: Login - SyS - 08.07.2016

Quote:
Originally Posted by Filbert
Посмотреть сообщение
You mean line 24158 in my pwn?
it's just 1 bracket and it's not in my problem.
I dont know your mean
not 24158 show 24518 and neighbouring lines (if you want)


Re: Login - Filbert - 08.07.2016

Scroll up it's 24518 line


Re: Login - Stinged - 08.07.2016

You can't have two "else"s for 1 if statement.


Re: Login - Filbert - 08.07.2016

So, what is the right code?
Please tell me...