Quote:
Originally Posted by Sime30
Complications, complications and complications... First of all, UPDATE only pos X , pos Y and pos Z on disconnect. Things like level , donate rank etc UPDATE when it changes. Second: Why do you need that type? Save it normally, like the God commands! Third, look at my codes below ----
pawn Код:
SaveAccount(playerid) { new Query[ 300 ]; mysql_format(MySQLHandle, Query, sizeof(Query), "UPDATE users SET SKILL_M4 = %d, SKILL_SNIPERRIFLE = %d WHERE IDPlayer = %d", PlayaInfo[ playerid ][ SKILL_M4 ], PlayaInfo[ playerid ][ SKILL_SNIPERRIFLE ], PlayaInfo[ playerid ][ IDPlayer ]); mysql_tquery(MySQLHandle, Query); //... }
Extra notes: When you are updating, just use mysql_tquery(Handle, Query); , there is no need for callbacks. Use callbacks when you are SELECTing or INSERTing.
cache_num_rows()
pawn Код:
forward OnAccountCheck(playerid); public OnAccountCheck(playerid) {
if(cache_num_rows()) {
|
I use that type for updating one by one. Like, when AdminLevel is changed, I will put just "Update(playerid, pAdminx);", I think it's faster then all that command, and it's easier to change... I will try to remake all gamemode, thanks for tip, I will be back if didn't work...