Not saving/loading Weapons [MYSQL] -
TheNerka - 29.08.2014
Hello why not loading and saving weapons?
MySQL Load
Код:
...
PlayerData[playerid][Weapon1] = cache_get_field_content_int(0, "Weapon1", Mysql_users);
PlayerData[playerid][Weapon1a] = cache_get_field_content_int(0, "Weapon1a", Mysql_users);
PlayerData[playerid][Weapon2] = cache_get_field_content_int(0, "Weapon2", Mysql_users);
PlayerData[playerid][Weapon2a] = cache_get_field_content_int(0, "Weapon2a", Mysql_users);
PlayerData[playerid][Weapon3] = cache_get_field_content_int(0, "Weapon3", Mysql_users);
PlayerData[playerid][Weapon3a] = cache_get_field_content_int(0, "Weapon3a", Mysql_users);
PlayerData[playerid][Weapon4] = cache_get_field_content_int(0, "Weapon4", Mysql_users);
PlayerData[playerid][Weapon4a] = cache_get_field_content_int(0, "Weapon4a", Mysql_users);
PlayerData[playerid][Weapon5] = cache_get_field_content_int(0, "Weapon5", Mysql_users);
PlayerData[playerid][Weapon5a] = cache_get_field_content_int(0, "Weapon5a", Mysql_users);
PlayerData[playerid][Weapon6] = cache_get_field_content_int(0, "Weapon6", Mysql_users);
PlayerData[playerid][Weapon6a] = cache_get_field_content_int(0, "Weapon6a", Mysql_users);
PlayerData[playerid][Weapon7] = cache_get_field_content_int(0, "Weapon7", Mysql_users);
PlayerData[playerid][Weapon7a] = cache_get_field_content_int(0, "Weapon7a", Mysql_users);
PlayerData[playerid][Weapon8] = cache_get_field_content_int(0, "Weapon8", Mysql_users);
PlayerData[playerid][Weapon8a] = cache_get_field_content_int(0, "Weapon8a", Mysql_users);
PlayerData[playerid][Weapon9] = cache_get_field_content_int(0, "Weapon9", Mysql_users);
PlayerData[playerid][Weapon9a] = cache_get_field_content_int(0, "Weapon9a", Mysql_users);
PlayerData[playerid][Weapon10] = cache_get_field_content_int(0, "Weapon10", Mysql_users);
PlayerData[playerid][Weapon10a] = cache_get_field_content_int(0, "Weapon10a", Mysql_users);
PlayerData[playerid][Weapon11] = cache_get_field_content_int(0, "Weapon11", Mysql_users);
PlayerData[playerid][Weapon11a] = cache_get_field_content_int(0, "Weapon11a", Mysql_users);
PlayerData[playerid][Weapon12] = cache_get_field_content_int(0, "Weapon12", Mysql_users);
PlayerData[playerid][Weapon12a] = cache_get_field_content_int(0, "Weapon12a", Mysql_users);
...
Код:
...
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon1], PlayerData[playerid][Weapon1a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon2], PlayerData[playerid][Weapon2a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon3], PlayerData[playerid][Weapon3a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon4], PlayerData[playerid][Weapon4a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon5], PlayerData[playerid][Weapon5a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon6], PlayerData[playerid][Weapon6a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon7], PlayerData[playerid][Weapon7a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon8], PlayerData[playerid][Weapon8a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon9], PlayerData[playerid][Weapon9a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon10], PlayerData[playerid][Weapon10a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon11], PlayerData[playerid][Weapon11a]);
GivePlayerWeapon(playerid, PlayerData[playerid][Weapon12], PlayerData[playerid][Weapon12a]);
...
MySQL Save:
Код:
...
GetPlayerWeaponData(playerid, 1, PlayerData[playerid][Weapon1], PlayerData[playerid][Weapon1a]);
GetPlayerWeaponData(playerid, 2, PlayerData[playerid][Weapon2], PlayerData[playerid][Weapon2a]);
GetPlayerWeaponData(playerid, 3, PlayerData[playerid][Weapon3], PlayerData[playerid][Weapon3a]);
GetPlayerWeaponData(playerid, 4, PlayerData[playerid][Weapon4], PlayerData[playerid][Weapon4a]);
GetPlayerWeaponData(playerid, 5, PlayerData[playerid][Weapon5], PlayerData[playerid][Weapon5a]);
GetPlayerWeaponData(playerid, 6, PlayerData[playerid][Weapon6], PlayerData[playerid][Weapon6a]);
GetPlayerWeaponData(playerid, 7, PlayerData[playerid][Weapon7], PlayerData[playerid][Weapon7a]);
GetPlayerWeaponData(playerid, 8, PlayerData[playerid][Weapon8], PlayerData[playerid][Weapon8a]);
GetPlayerWeaponData(playerid, 9, PlayerData[playerid][Weapon9], PlayerData[playerid][Weapon9a]);
GetPlayerWeaponData(playerid, 10, PlayerData[playerid][Weapon10], PlayerData[playerid][Weapon10a]);
GetPlayerWeaponData(playerid, 11, PlayerData[playerid][Weapon11], PlayerData[playerid][Weapon11a]);
GetPlayerWeaponData(playerid, 12, PlayerData[playerid][Weapon12], PlayerData[playerid][Weapon12a]);
...
Код:
...
mysql_format(Mysql_users, query, sizeof(query), "%s, Weapon1='%d', Weapon1a='%d', Weapon2='%d', Weapon2a='%d', Weapon3='%d', Weapon3a='%d', Weapon4='%d', Weapon4a='%d', Weapon5='%d', Weapon5a='%d', Weapon6='%d', Weapon6a='%d'",\
query,
PlayerData[playerid][Weapon1],
PlayerData[playerid][Weapon1a],
PlayerData[playerid][Weapon2],
PlayerData[playerid][Weapon2a],
PlayerData[playerid][Weapon3],
PlayerData[playerid][Weapon3a],
PlayerData[playerid][Weapon4],
PlayerData[playerid][Weapon4a],
PlayerData[playerid][Weapon5],
PlayerData[playerid][Weapon5a],
PlayerData[playerid][Weapon6],
PlayerData[playerid][Weapon6a]);
mysql_format(Mysql_users, query, sizeof(query), "%s, Weapon7='%d', Weapon7a='%d', Weapon8='%d', Weapon8a='%d', Weapon9='%d', Weapon9a='%d', Weapon10='%d', Weapon10a='%d', Weapon11='%d', Weapon11a='%d', Weapon12='%d', Weapon12a='%d' WHERE Fullname='%e'",\
query,
PlayerData[playerid][Weapon7],
PlayerData[playerid][Weapon7a],
PlayerData[playerid][Weapon8],
PlayerData[playerid][Weapon8a],
PlayerData[playerid][Weapon9],
PlayerData[playerid][Weapon9a],
PlayerData[playerid][Weapon10],
PlayerData[playerid][Weapon10a],
PlayerData[playerid][Weapon11],
PlayerData[playerid][Weapon11a],
PlayerData[playerid][Weapon12],
PlayerData[playerid][Weapon12a],
GetPlayersName(playerid));
mysql_tquery(Mysql_users, query, "", "");
...
mysql_log no error
Код:
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon1", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon1a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon2", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon2a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon3", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon3a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon4", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon4a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon5", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon5a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon6", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon6a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon7", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon7a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon8", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon8a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon9", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon9a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon10", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon10a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon11", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon11a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon12", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
[09:50:28] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weapon12a", connection: 1
[09:50:28] [WARNING] cache_get_field_content_int - no active cache
Re: Not saving/loading Weapons [MYSQL] -
TheNerka - 29.08.2014
HELP!
Re: Not saving/loading Weapons [MYSQL] -
Clad - 29.08.2014
You can only bump each 24 Hour.