24.02.2014, 08:20
The problem is that it shows as NULL and doesnt display the name of adminlevel and skin, nor does it add a value like 299(skinid)
I messed around with int() and set it at int(10), that makes the names display in database instead of being blank.
What's the correct value to use for skin and adminlevel? max adminlevel would be 6.
The save code incase there's an error there.
I messed around with int() and set it at int(10), that makes the names display in database instead of being blank.
What's the correct value to use for skin and adminlevel? max adminlevel would be 6.
pawn Код:
mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `users` ( \
`id` int(11) NOT NULL AUTO_INCREMENT, \
`name` varchar(24) NOT NULL, \
`pass` varchar(129) NOT NULL, \
`salt` varchar(30) NOT NULL, \
`health` float NOT NULL, \
`armor` float NOT NULL, \
`X` float NOT NULL, \
`Y` float NOT NULL, \
`Z` float NOT NULL, \
`A` float NOT NULL, \
`interior` int(2) NOT NULL, \
`vw` int(11) NOT NULL, \
`skin` int(3) NOT NULL, \
`adminlevel` int(2) NOT NULL, \
PRIMARY KEY (`id`) \
)", false, "SendQuery", "");
The save code incase there's an error there.
Код:
stock SaveAccount(playerid) { new query[600], Float:pos[4], Float:health, Float:armor; GetPlayerPos(playerid, posArr{pos}); GetPlayerFacingAngle(playerid, pos[3]); GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armor); format(query, sizeof(query), "UPDATE `users` SET health = %.1f, armor = %.1f, X = %.2f, Y = %.2f, Z = %.2f, A = %.2f, interior = %d, vw = %d, skin = %d, adminlevel = %d WHERE `id` = %d", health, armor, posArrEx{pos}, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid), GetPlayerSkin(playerid), g_PlayerInfo[playerid][pAdminLevel], g_PlayerInfo[playerid][pSQLid] ); mysql_function_query(g_Handle, query, false, "SendQuery", ""); return 1; }