[Pawn] sqlite and inputtext - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] sqlite and inputtext (/showthread.php?tid=1790) |
sqlite and inputtext - robertocaribbean - 2021-03-21 I am trying to create an SQLite database, I only have three variables to keep it simple. The problem is that the password is not saved unless I pass <inputtext> directly to the query. Variables: Code: enum USER_DATA { Code working: Code: public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { Code isn't working: Code: gUserData[playerid][USER_PASSWORD] = inputtext[strlen(inputtext)];? ? ? ? ? ? The password field on the database is empty, and other values are ok. No error has given from the compiler. RE: sqlite and inputtext - Pinch - 2021-03-21 If you're using YSI, just do this: Code: strcpy(gUserData[playerid][USER_PASSWORD], inputtext); It should work now. RE: sqlite and inputtext - robertocaribbean - 2021-03-21 (2021-03-21, 05:45 PM)Pinch Wrote: If you're using YSI, just do this: Thank you! I am trying to add y_svar but the compiler throws an error. Code: C:\Projects\SAMP\Server\dependencies\YSI-Includes\YSI_Storage\y_svar\y_svar_ini.inc:122 (error) undefined symbol "INI_WriteArray" Do you know how to fix it? Code: #define MODE_NAME "SavedText" I placed it after the "fixes" include. I also tried placing it in a place before "fixes" but it throws other even weirder errors. RE: sqlite and inputtext - Bakr - 2021-03-21 Code: gUserData[playerid][USER_PASSWORD] = inputtext[strlen(inputtext)]; That's your problem. Code: inputtext="Hello" You're assigned EOS to the first element of gUserData[playerid][USER_PASSWORD], which results in an empty string. Just concatenate it to the array. Code: strcat(gUserData[playerid][USER_PASSWORD], inputtext, 20); May I interest you? https://burgershot.gg/showthread.php?tid=1419 RE: sqlite and inputtext - robertocaribbean - 2021-03-21 (2021-03-21, 08:25 PM)Bakr Wrote: Thank you very much for the explanation! I found the code and what you have explained helpfully. The database stores the passwords now. I'm going to take a look at samp-account, it looks interesting. RE: sqlite and inputtext - Threshold - 2021-03-24 You should never store passwords in plain text form... always hash your passwords. It's a breach of both security and privacy. RE: sqlite and inputtext - robertocaribbean - 2021-03-24 (2021-03-24, 04:46 AM)Threshold Wrote: You should never store passwords in plain text form... always hash your passwords. It's a breach of both security and privacy. Yes, I am currently using bcrypt. I just wanted to know the process of how to store a password and then implement bcrypt. |