Inputtext
#1

Hello everyone,
I've a problem on "inputtext"
I wanna use this script:
PHP код:
            if(strval(inputtext) != PINFO[playerid][pKey])
            {
            
ShowPlayerDialog(playerid,DIALOG_CHANGE_PASSWORDN,DIALOG_STYLE_INPUT"Password""{FF0000}You're entered a WRONG password.\n\n{A9C4E4}Please enter your {FF0000}current{A9C4E4} password below.""Done""Cancel");
            return 
1;
            } 
but it doesn't work, why?! (This script will compiled but doesn't work) WHEN I USE ANY PASSWORD THIS DIALOG WILL BE SHOWN

SORRY FOR BAD ENGLISH
Reply
#2

Your password is only integers?
Reply
#3

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Your password is only integers?
No my password is: AA1953..
but I don't know strval(inputtext) is right or not.
I want some thing like strval(inputtext) but that use for integers and letters....
can you help me?
Reply
#4

you gotta use strcmp, not strval.
strval will convert string (inputtext in this case) to an integer value.

BUT.. that's not the good way to do this.
you should encrypt/hash/encode you players' passwords DO NOT store them in plain text! which I believe what's you are doing right now.
Reply
#5

Quote:
Originally Posted by iAmir
Посмотреть сообщение
you gotta use strcmp, not strval.
strval will convert string (inputtext in this case) to an integer value.

BUT.. that's not the good way to do this.
you should encrypt/hash/encode you players' passwords DO NOT store them in plain text! which I believe what's you are doing right now.
TYY ++REP
Reply
#6

Quote:
Originally Posted by SiNaGaMeR
Посмотреть сообщение
No my password is: AA1953..
but I don't know strval(inputtext) is right or not.
I want some thing like strval(inputtext) but that use for integers and letters....
can you help me?
What strval does is convert a string to an integer, if your password was only integers then that would work, however it isn't. So what you should do is use strcmp (string compare) to compare if what the player has input is not the same as the password.

Код:
if(strcmp(inputtext, PINFO[playerid][pKey]))
{ 
    ShowPlayerDialog(playerid,DIALOG_CHANGE_PASSWORDN,DIALOG_STYLE_INPUT, "Password", "{FF0000}You're entered a WRONG password.\n\n{A9C4E4}Please enter your {FF0000}current{A9C4E4} password below.", "Done", "Cancel"); 
    return 1; 
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)