SavePlayerData() Setting nearly everything to 0. -
Also, SaveWeapons(playerid) is not working either. Which saves armour.
I load everything under DIALOG_LOGIN.
It does work.
SaveData.
pawn Код:
stock SavePlayerData(playerid)
{
new playerip[16], query[128];
if(LoggedIn[playerid] == 1)
{
printf("playerid %d", playerid);
PlayerSQLID[playerid] = MySQL_GetValue(PlayerSQLID[playerid], "id", "accounts");
printf("playersqlid %d", PlayerSQLID[playerid]);
MySQL_SetInteger(PlayerSQLID[playerid], "TotalTime", TotalTime[playerid], "accounts");
printf("TotalTime %d", TotalTime[playerid]);
MySQL_SetInteger(PlayerSQLID[playerid], "BankMoney", BankMoney[playerid], "accounts");
printf("Bank Money %d", BankMoney[playerid]);
PlayerSkin[playerid] = GetPlayerSkin(playerid);
printf("PlayerSkin %d", PlayerSkin[playerid]);
MySQL_SetInteger(PlayerSQLID[playerid], "Skin", PlayerSkin[playerid], "accounts");
PlayerMoney[playerid] = GetPlayerMoney(playerid);
MySQL_SetInteger(PlayerSQLID[playerid], "Money", PlayerMoney[playerid], "accounts");
printf("PlayerMoney %d", PlayerMoney[playerid]);
MySQL_SetInteger(PlayerSQLID[playerid], "Cocaine", Cocaine[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "Weed", Weed[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "SGrip", SGrip[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "MGrip", MGrip[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "LGrip", LGrip[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "SFrame", SFrame[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "MFrame", MFrame[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "LFrame", LFrame[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "SBarrel", SBarrel[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "MBarrel", MBarrel[playerid], "accounts");
MySQL_SetInteger(PlayerSQLID[playerid], "LBarrel", LBarrel[playerid], "accounts");
GetPlayerIp(playerid, playerip, sizeof(playerip));
format(query, sizeof(query), "UPDATE `accounts` SET `PlayerIP` = '%s' WHERE `id` = '%d' LIMIT 1", playerip,PlayerSQLID[playerid]);
mysql_query(query);
}
return 1;
}