05.08.2010, 07:39
Nice way of setting up man, its a lot cleaner than the way i was doing it.
Just one thing. There isnt really much point to do this
Your much better off just updating what you need to update. Its not like their password ever changes while they are logged in unless your going to add a change password option or something.
My Way
Just thought id let ya know =D
Just one thing. There isnt really much point to do this
Code:
SavePlayer(playerid) { if(!PlayerLogged[playerid]) return 0; UserStats[playerid][Money] = GetPlayerMoney(playerid); CheckMySQL(); new string[256]; format(string, sizeof(string), "UPDATE Users SET Password='%s', Admin='%d', Money='%d' WHERE Name='%s'", UserStats[playerid][Password], UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Name]); mysql_query(string); return 1; }
My Way
Code:
SavePlayer(playerid) { if(!PlayerLogged[playerid]) return 0; UserStats[playerid][Money] = GetPlayerMoney(playerid); CheckMySQL(); new string[256]; format(string, sizeof(string), "UPDATE `users` SET `admin`='%d', `money`='%d' WHERE `name`='%s'", UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Name]); mysql_query(string); return 1; }