09.03.2013, 15:40
Hey guys, this just started not long ago. I logged into my server, and made a new account. Then, I saw that the account wouldn't save and that it wouldn't make a new account in the database. I'm really annoyed, and I tried again and again and it still wouldn't work. Here is my Register stock:
This on OnGameModeInit:
I really hope you can help me here in this hard situation! Thanks
pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
new query[200], pname[24], IP[16];
GetPlayerName(playerid, pname, 24);
GetPlayerIp(playerid, IP, 16);
format(query, sizeof(query), "INSERT INTO playerdata (user, password, Adminlevel, score, money, IP, Register Date) VALUES('%s', SHA1('%s'), 0, 0, 0, '%s', NOW())", pname, passwordstring, IP);
mysql_query(query);
SendClientMessage(playerid, INFO, ">> You have sucesfully registered a new account!");
Logged[playerid] = 1;
return 1;
}
This on OnGameModeInit:
pawn Код:
mysql_query("CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(41), Adminlevel INT(11), score INT(20), money INT(20), IP VARCHAR(16) )");