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", "");
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; }
Create your table in phpMyAdmin (usually at http://localhost/phpmyadmin), where you can actually see what's wrong.
|
stock SavePlayerWeapons(playerid)
{
new
query[300],
weapon0[MAX_PLAYERS],
ammo0[MAX_PLAYERS],
weapon1[MAX_PLAYERS],
ammo1[MAX_PLAYERS];
GetPlayerWeaponData(playerid, 0, weapon0[playerid], ammo0[playerid]);
GetPlayerWeaponData(playerid, 1, weapon1[playerid], ammo1[playerid]);
format(query, sizeof(query), "UPDATE `users` SET weapon0 = %d, ammo0 = %d, weapon1 = %d, ammo1 = %d WHERE `id` = %d",
weapon0,
ammo0,
weapon1,
ammo1
);
mysql_function_query(g_Handle, query, false, "SendQuery", "");
return 1;
}