MySQL R7 problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL R7 problem (
/showthread.php?tid=396144)
MySQL R7 problem -
ADY26 - 29.11.2012
So i made three rows ( Vip , tkicked and tkickeda ) vip is vip level , tkicked is how many times was the player kicked and tkickeda how many times he kicked a player as admin.. but the problem is that in DB they are 0 and in game random number like : 55 , 50 , 53 but the admin row works perfectly..
So what could be the problem ?
What part of code should i show ?
Re: MySQL R7 problem -
SuperViper - 29.11.2012
Those are all supposed to be integers, you might be saving or loading them as strings.
Re: MySQL R7 problem -
ADY26 - 29.11.2012
Quote:
Originally Posted by SuperViper
Those are all supposed to be integers, you might be saving or loading them as strings.
|
In database they are integers.
Load :
pawn Код:
cache_get_field_content(0, "Vip", temp), PlayerData[playerid][pVip] = strval(temp);
cache_get_field_content(0, "TKicked", temp), PlayerData[playerid][pTKicked] = strval(temp);
cache_get_field_content(0, "TKickeda", temp), PlayerData[playerid][pTKickeda] = strval(temp);
I don't have save because i don't need to.
Also the callback is called by this :
pawn Код:
format(query, sizeof(query), "SELECT * FROM `users` WHERE `id` = %d", PlayerData[playerid][pSQLid]);
mysql_function_query(g_Handle, query, true, "OnAccountLoad", "d", playerid);
That d should be for all fields that i load .. ?