I need a code where I can get my saved variables from the database.
I made the register code, but I don't know how I can get the vars into my account.
Код:
CMD:login(playerid, params[])
{
new string[128];
if(strlen(params))==0) return SendClientMessage(playerid, _COLOR_RED, "false pw.");
format(string, 128, "SELECT * FROM users WHERE name = '%s'", PlayerName(playerid));
mysql_query(string);
mysql_store_result();
if(mysql_num_rows() != 0)
{
format(string, 128, "SELECT `pass` FROM `users` WHERE `name` = '%s'", PlayerName(playerid));
mysql_query(string);
GivePlayerMoney(playerid,);
mysql_free_result();
}
else
{
SendClientMessage(playerid, _COLOR_RED, "error.");
return 1;
}
return 1;
}