Password not writing
#1

I made this code with strickens plugin
pawn Код:
command(register, playerid, params[])
{
    new string[128];
    format(string, sizeof(string), "INSERT INTO Users (Name,Password) VALUES ('%s','%s')", playerinfo[playerid][Name], playerinfo[playerid][Password]);
    mysql_query(string);
    SavePlayer(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "[ACCOUNT] Your account has been created, please login now!");
    return 1;
}
But I got one problem this is writing the Name to the DB but the Password is not Writing what is wrong here?

EDIT: Im not going make the login because theres no place to load the password xD
Reply
#2

Remember to hash the password!
Reply
#3

Can you explain me how i can make it?
Reply
#4

I'm a bit busy now but, you can ask in this topic: https://sampforum.blast.hk/showthread.php?tid=65290
Reply
#5

ok thats to encrypt the password and i just want to write the password to the DB but is not writing.what is wrong with my code?
Reply
#6

Well, you just send "playerinfo[playerid][Password]" to the server which doesn't contain any information at that point, replace it with "params".
Reply
#7

params are not working too..
pawn Код:
command(register, playerid, params[])
{
    new string[128];
    format(string, sizeof(string), "INSERT INTO Users (Name,Password) VALUES ('%s','%s')", playerinfo[playerid][Name], params);
    mysql_query(string);
    SavePlayer(playerid);
    SendClientMessage(playerid, COLOR_YELLOW, "[ACCOUNT] Your account has been created, please login now!");
    return 1;
}
Thats the code
Reply
#8

i will try to create a call back for this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)