SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/11/2014, 04:49 PM   #1
Sellize
Gangsta
 
Sellize's Avatar
 
Join Date: Jan 2013
Location: (ง ͠ ͟ل͜ ͡)ง fight me irl
Posts: 708
Reputation: 293
Default Get 'false password' error eventhough password is correct

I put the correct pass but still it throws the error, why?

Code:
case DIALOG_LOGIN:
        {
            if (!response) return Kick ( playerid );
            if(response)
            {
                if(strcmp(inputtext, PlayerInfo[playerid][pPass], false))
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoneyEx(playerid, PlayerInfo[playerid][pCash]);
                    welcome(playerid);
                    NewMoney[playerid] = GetPlayerMoney(playerid);
                    PlayerInfo[playerid][pLogged] = 1;
                    ForceClassSelection(playerid);
				    TogglePlayerSpectating(playerid, true);
				    TogglePlayerSpectating(playerid, false);
                }
                else
                {
					slowkick(playerid, "Invalid password");
					PlayerInfo[playerid][pLogged] = 0;
                }
                return 1;
            }
        }
__________________
dead
Sellize is offline   Reply With Quote
Old 14/11/2014, 05:11 PM   #2
DavidBilla
Huge Clucker
 
DavidBilla's Avatar
 
Join Date: Aug 2013
Location: Planet Earth
Posts: 303
Reputation: 35
Default Re: Get 'false password' error eventhough password is correct

if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))

This will fix it.
Strcmp returns 0 when both strings match, that's why you put '!'
__________________
DavidBilla is offline   Reply With Quote
Old 15/11/2014, 08:06 AM   #3
Sellize
Gangsta
 
Sellize's Avatar
 
Join Date: Jan 2013
Location: (ง ͠ ͟ل͜ ͡)ง fight me irl
Posts: 708
Reputation: 293
Default Re: Get 'false password' error eventhough password is correct

Quote:
Originally Posted by DavidBilla View Post
if(!strcmp(inputtext, PlayerInfo[playerid][pPass], false))

This will fix it.
Strcmp returns 0 when both strings match, that's why you put '!'
Thank I shouldve known
__________________
dead
Sellize is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct password but wrong ? SlayerS Scripting Help 4 01/03/2014 04:11 PM
Password Incorrect even when correct AaronFarley Scripting Help 15 25/06/2013 04:02 PM
User without enter correct password can logged in 31fahmi Scripting Help 28 09/03/2013 05:56 PM
Error: Your password must be changed from the default password, please change it Zurrek Server Support 4 03/05/2009 06:44 AM
Error with password NIck k. Server Support 25 16/01/2009 09:18 PM


All times are GMT. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.