03.06.2020, 05:15
(
Last edited by SkyFlare; 03/06/2020 at 07:54 AM.
)
So in my Script, I am updating SQL Data as it changes as you should...
For example:
But when a player Leaves the Server... I am in conjunction, saving all data...
I fear this is going to be quite harsh on MySQL and Server Performance, wondering if/how I can make a check to see if SQL Entry is required or not, for each of these, without also causing stress on the server too.
For example:
Code:
CMD:unbagounce(playerid, params[])
{
UpdateSQLPlayerMarijuanaData(playerid);
return 1;
}
Code:
UpdateSQLPlayerMarijuanaData(playerid)
{
mysql_format(g_SQL, query, sizeof query, "UPDATE `x` SET `x` = %d WHERE `x` = %d LIMIT 1", x, x);
mysql_tquery(g_SQL, query);
return 1;
}
Code:
UpdatePlayerData(playerid)
{
if (Player[playerid][IsLoggedIn] == false) return 0;
if(Player[playerid][PlayerSpawnCalled] != false)
{
UpdateSQLPlayerPosData(playerid);
UpdateSQLPlayerFamilyData(playerid);
UpdateSQLPlayerFactionData(playerid);
UpdateSQLPlayerCharacterData(playerid);
UpdateSQLPlayerLevelGroupData(playerid);
UpdateSQLPlayerAccountData(playerid);
UpdateSQLPlayerMarijuanaData(playerid);
UpdateSQLPlayerWeaponData(playerid);
UpdateSQLPlayerChatToggles(playerid);
UpdateSQLPlayerHouseData(playerid);
UpdateSQLPlayerPhoneData(playerid);
UpdateSQLPlayerChatTitles(playerid);
}
#if DEBUG_FUNCTIONS == true
print("DEBUG: UpdatePlayerData Called");
#endif
return 1;
}


