Skip to content

Commit

Permalink
Make name/steamid columns non-nullable to fix primary key error on MY…
Browse files Browse the repository at this point in the history
…SQL 5.7+ - fixes #51.
  • Loading branch information
TheDoctor0 committed Sep 5, 2020
1 parent 2424f58 commit 54351db
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 113 deletions.
35 changes: 16 additions & 19 deletions cstrike/addons/amxmodx/scripting/csgo_accounts.sma
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ public client_connect(id)

if (is_user_bot(id) || is_user_hltv(id) || !accountsEnabled) return;

get_user_authid(id, playerData[id][STEAM_ID], charsmax(playerData[][STEAM_ID]));
get_user_name(id, playerData[id][NAME], charsmax(playerData[][NAME]));

switch (saveType) {
case SAVE_NAME: mysql_escape_string(playerData[id][NAME], playerData[id][SAFE_NAME], charsmax(playerData[][SAFE_NAME]));
case SAVE_STEAM_ID: get_user_authid(id, playerData[id][STEAM_ID], charsmax(playerData[][STEAM_ID]));
}
mysql_escape_string(playerData[id][NAME], playerData[id][SAFE_NAME], charsmax(playerData[][SAFE_NAME]));

set_task(0.1, "load_account", id + TASK_LOAD);
}
Expand Down Expand Up @@ -669,7 +667,7 @@ public sql_init()

new queryData[192], bool:hasError;

formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_accounts` (`name` VARCHAR(64) DEFAULT NULL, `steamid` VARCHAR(35) DEFAULT NULL, `pass` VARCHAR(32), PRIMARY KEY(name, steamid));");
formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_accounts` (`name` VARCHAR(64), `steamid` VARCHAR(35), `pass` VARCHAR(32), PRIMARY KEY(name, steamid));");

new Handle:query = SQL_PrepareQuery(connection, queryData);

Expand Down Expand Up @@ -702,8 +700,8 @@ public load_account(id)
tempId[0] = id;

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_accounts` WHERE name = ^"%s^"", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_accounts` WHERE steamid = ^"%s^"", playerData[id][STEAM_ID]);
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_accounts` WHERE name = ^"%s^" LIMIT 1;", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_accounts` WHERE steamid = ^"%s^" LIMIT 1;", playerData[id][STEAM_ID]);
}

SQL_ThreadQuery(sql, "load_account_handle", queryData, tempId, sizeof(tempId));
Expand Down Expand Up @@ -754,23 +752,22 @@ public account_query(id, type)
{
if (!is_user_connected(id)) return;

new queryData[128], password[32];
new queryData[192], password[32];

mysql_escape_string(playerData[id][PASSWORD], password, charsmax(password));

switch (saveType) {
case SAVE_NAME: {
switch (type) {
case INSERT: formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_accounts` (name, pass) VALUES (^"%s^", '%s')", playerData[id][SAFE_NAME], password);
case UPDATE: formatex(queryData, charsmax(queryData), "UPDATE `csgo_accounts` SET pass = '%s' WHERE name = ^"%s^"", password, playerData[id][SAFE_NAME]);
case DELETE: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_accounts` WHERE name = ^"%s^"", playerData[id][SAFE_NAME]);
switch (type) {
case INSERT: formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_accounts` (name, steamid, pass) VALUES (^"%s^", ^"%s^", ^"%s^")", playerData[id][SAFE_NAME], playerData[id][STEAM_ID], password);
case UPDATE: {
switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "UPDATE `csgo_accounts` SET pass = '%s', steamid = ^"%s^" WHERE name = ^"%s^"", password, playerData[id][STEAM_ID], playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "UPDATE `csgo_accounts` SET pass = '%s', name = ^"%s^" WHERE steamid = ^"%s^"", password, playerData[id][SAFE_NAME], playerData[id][STEAM_ID]);
}
}
case SAVE_STEAM_ID: {
switch (type) {
case INSERT: formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_accounts` (steamid, pass) VALUES (^"%s^", '%s')", playerData[id][STEAM_ID], password);
case UPDATE: formatex(queryData, charsmax(queryData), "UPDATE `csgo_accounts` SET pass = '%s' WHERE steamid = ^"%s^"", password, playerData[id][STEAM_ID]);
case DELETE: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_accounts` WHERE steamid = ^"%s^"", playerData[id][STEAM_ID]);
case DELETE: {
switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_accounts` WHERE name = ^"%s^"", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_accounts` WHERE steamid = ^"%s^"", playerData[id][STEAM_ID]);
}
}
}
Expand Down
27 changes: 12 additions & 15 deletions cstrike/addons/amxmodx/scripting/csgo_clans.sma
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ public sql_init()

SQL_Execute(query);

formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_clans_members` (`name` varchar(64) DEFAULT NULL, `steamid` VARCHAR(35) DEFAULT NULL, `clan` INT NOT NULL, ");
formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_clans_members` (`name` varchar(64), `steamid` VARCHAR(35), `clan` INT NOT NULL, ");
add(queryData, charsmax(queryData), "`flag` INT NOT NULL DEFAULT 0, `deposit` DOUBLE(16, 2) NOT NULL DEFAULT 0, `withdraw` DOUBLE(16, 2) NOT NULL DEFAULT 0, PRIMARY KEY (name, steamid));");

query = SQL_PrepareQuery(connection, queryData);
Expand All @@ -2506,7 +2506,7 @@ public sql_init()
hasError = true;
}

formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_clans_applications` (`name` VARCHAR(64) DEFAULT NULL, `steamid` VARCHAR(35) DEFAULT NULL, `clan` INT NOT NULL, PRIMARY KEY (name, steamid, clan));");
formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_clans_applications` (`name` VARCHAR(64), `steamid` VARCHAR(35), `clan` INT NOT NULL, PRIMARY KEY (name, steamid, clan));");

query = SQL_PrepareQuery(connection, queryData);

Expand Down Expand Up @@ -2573,8 +2573,8 @@ public load_clan_data(id)
tempId[0] = id;

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT a.flag, b.* FROM `csgo_clans_members` a JOIN `csgo_clans` b ON a.clan = b.id WHERE a.name = ^"%s^"", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT a.flag, a.name as nick, b.* FROM `csgo_clans_members` a JOIN `csgo_clans` b ON a.clan = b.id WHERE a.steamid = ^"%s^"", playerData[id][STEAM_ID]);
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT a.flag, b.* FROM `csgo_clans_members` a JOIN `csgo_clans` b ON a.clan = b.id WHERE a.name = ^"%s^" LIMIT 1;", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT a.flag, a.name as nick, b.* FROM `csgo_clans_members` a JOIN `csgo_clans` b ON a.clan = b.id WHERE a.steamid = ^"%s^" LIMIT 1;", playerData[id][STEAM_ID]);
}

SQL_ThreadQuery(sql, "load_clan_data_handle", queryData, tempId, sizeof(tempId));
Expand Down Expand Up @@ -2645,10 +2645,7 @@ public load_clan_data_handle(failState, Handle:query, error[], errorNum, tempId[
} else {
new queryData[256];

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "INSERT IGNORE INTO `csgo_clans_members` (`name`) VALUES (^"%s^")", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "INSERT IGNORE INTO `csgo_clans_members` (`name`, `steamid`) VALUES (^"%s^", ^"%s^")", playerData[id][SAFE_NAME], playerData[id][STEAM_ID]);
}
formatex(queryData, charsmax(queryData), "INSERT IGNORE INTO `csgo_clans_members` (`name`, `steamid`) VALUES (^"%s^", ^"%s^")", playerData[id][SAFE_NAME], playerData[id][STEAM_ID]);

SQL_ThreadQuery(sql, "ignore_handle", queryData);
}
Expand Down Expand Up @@ -2739,15 +2736,18 @@ public _csgo_get_clan_members(clanId)

stock save_member(id, status = 0, change = 0, const userName[] = "", const userSteamId[] = "")
{
new queryData[256], safeName[64], setWhereClause[128], whereClause[64];
new queryData[256], safeName[64], playerSteamId[35], setWhereClause[128], whereClause[64];

if (strlen(userName)) mysql_escape_string(userName, safeName, charsmax(safeName));
else copy(safeName, charsmax(safeName), playerData[id][SAFE_NAME]);

if (strlen(userSteamId)) copy(playerSteamId, charsmax(playerSteamId), userSteamId);
else copy(playerSteamId, charsmax(playerSteamId), playerData[id][STEAM_ID]);

switch (saveType) {
case SAVE_NAME: {
formatex(whereClause, charsmax(whereClause), " WHERE name = ^"%s^"", safeName);
formatex(setWhereClause, charsmax(setWhereClause), " WHERE name = ^"%s^"", safeName);
formatex(setWhereClause, charsmax(setWhereClause), ", steamid = ^"%s^" WHERE name = ^"%s^"", playerSteamId, safeName);
}
case SAVE_STEAM_ID: {
new playerSteamId[35];
Expand Down Expand Up @@ -2966,7 +2966,7 @@ stock add_payment(id, Float:money, withdraw = false)
formatex(type, charsmax(type), "%s", withdraw ? "withdraw" : "deposit");

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "UPDATE `csgo_clans_members` SET %s = %s + %.2f WHERE name = ^"%s^"", type, type, money, playerData[id][SAFE_NAME]);
case SAVE_NAME: formatex(queryData, charsmax(queryData), "UPDATE `csgo_clans_members` SET %s = %s + %.2f, steamid = ^"%s^" WHERE name = ^"%s^"", type, type, money, playerData[id][STEAM_ID], playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "UPDATE `csgo_clans_members` SET %s = %s + %.2f, name = ^"%s^" WHERE steamid = ^"%s^"", type, type, money, playerData[id][SAFE_NAME], playerData[id][STEAM_ID]);
}

Expand All @@ -2977,10 +2977,7 @@ stock add_application(id, clanId)
{
new queryData[256];

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "INSERT IGNORE INTO `csgo_clans_applications` (`name`, `clan`) VALUES (^"%s^", '%i');", playerData[id][SAFE_NAME], clanId);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "INSERT IGNORE INTO `csgo_clans_applications` (`name`, `steamid`, `clan`) VALUES (^"%s^", ^"%s^", '%i');", playerData[id][SAFE_NAME], playerData[id][STEAM_ID], clanId);
}
formatex(queryData, charsmax(queryData), "INSERT IGNORE INTO `csgo_clans_applications` (`name`, `steamid`, `clan`) VALUES (^"%s^", ^"%s^", '%i');", playerData[id][SAFE_NAME], playerData[id][STEAM_ID], clanId);

SQL_ThreadQuery(sql, "ignore_handle", queryData);

Expand Down
50 changes: 18 additions & 32 deletions cstrike/addons/amxmodx/scripting/csgo_core.sma
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public plugin_cfg()

new queryData[256], bool:hasError;

formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_skins` (name VARCHAR(64) DEFAULT NULL, steamid VARCHAR(35) DEFAULT NULL, weapon VARCHAR(35), skin VARCHAR(64), count INT NOT NULL DEFAULT 1, PRIMARY KEY(name, steamid, weapon, skin));");
formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_skins` (name VARCHAR(64), steamid VARCHAR(35), weapon VARCHAR(35), skin VARCHAR(64), count INT NOT NULL DEFAULT 1, PRIMARY KEY(name, steamid, weapon, skin));");

new Handle:query = SQL_PrepareQuery(connection, queryData);

Expand All @@ -331,7 +331,7 @@ public plugin_cfg()
hasError = true;
}

formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_data` (name VARCHAR(64) DEFAULT NULL, steamid VARCHAR(35) DEFAULT NULL, money FLOAT NOT NULL DEFAULT 0, exchange INT NOT NULL DEFAULT 0, menu INT NOT NULL DEFAULT 0, online INT NOT NULL DEFAULT 0, PRIMARY KEY(steamid, name));");
formatex(queryData, charsmax(queryData), "CREATE TABLE IF NOT EXISTS `csgo_data` (name VARCHAR(64), steamid VARCHAR(35), money FLOAT NOT NULL DEFAULT 0, exchange INT NOT NULL DEFAULT 0, menu INT NOT NULL DEFAULT 0, online INT NOT NULL DEFAULT 0, PRIMARY KEY(steamid, name));");

query = SQL_PrepareQuery(connection, queryData);

Expand Down Expand Up @@ -2977,8 +2977,8 @@ public load_data(id)
playerId[0] = id;

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_data` WHERE `name` = ^"%s^"", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_data` WHERE `steamid` = ^"%s^"", playerData[id][STEAM_ID]);
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_data` WHERE `name` = ^"%s^" LIMIT 1;", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_data` WHERE `steamid` = ^"%s^" LIMIT 1;", playerData[id][STEAM_ID]);
}

SQL_ThreadQuery(sql, "load_data_handle", queryData, playerId, sizeof(playerId));
Expand All @@ -3002,16 +3002,8 @@ public load_data_handle(failState, Handle:query, error[], errorNum, playerId[],
} else {
new queryData[256];

switch (saveType) {
case SAVE_NAME: {
formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_data` (`name`, `money`, `exchange`, `menu`, `online`) VALUES (^"%s^", '0', '0', '0', '0');",
playerData[id][SAFE_NAME]);
}
case SAVE_STEAM_ID: {
formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_data` (`steamid`, `money`, `exchange`, `menu`, `online`) VALUES (^"%s^", '0', '0', '0', '0');",
playerData[id][STEAM_ID]);
}
}
formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_data` (`name`, `steamid`, `money`, `exchange`, `menu`, `online`) VALUES (^"%s^",^"%s^", '0', '0', '0', '0');",
playerData[id][SAFE_NAME], playerData[id][STEAM_ID]);

SQL_ThreadQuery(sql, "ignore_handle", queryData);
}
Expand All @@ -3029,12 +3021,12 @@ stock save_data(id, end = 0)

switch (saveType) {
case SAVE_NAME: {
formatex(queryData, charsmax(queryData), "UPDATE `csgo_data` SET `money` = %f, `exchange` = %i, `menu` = %i, `online` = %i WHERE `name` = ^"%s^"",
playerData[id][MONEY], playerData[id][EXCHANGE_BLOCKED], playerData[id][MENU_BLOCKED], end ? 0 : 1, playerData[id][SAFE_NAME]);
formatex(queryData, charsmax(queryData), "UPDATE `csgo_data` SET `money` = %f, `exchange` = %i, `menu` = %i, `online` = %i, `steamid` = ^"%s^" WHERE `name` = ^"%s^";",
playerData[id][MONEY], playerData[id][EXCHANGE_BLOCKED], playerData[id][MENU_BLOCKED], end ? 0 : 1, playerData[id][STEAM_ID], playerData[id][SAFE_NAME]);
}
case SAVE_STEAM_ID: {
formatex(queryData, charsmax(queryData), "UPDATE `csgo_data` SET `money` = %f, `exchange` = %i, `menu` = %i, `online` = %i WHERE `steamid` = ^"%s^"",
playerData[id][MONEY], playerData[id][EXCHANGE_BLOCKED], playerData[id][MENU_BLOCKED], end ? 0 : 1, playerData[id][STEAM_ID]);
formatex(queryData, charsmax(queryData), "UPDATE `csgo_data` SET `money` = %f, `exchange` = %i, `menu` = %i, `online` = %i, `name` = ^"%s^" WHERE `steamid` = ^"%s^";",
playerData[id][MONEY], playerData[id][EXCHANGE_BLOCKED], playerData[id][MENU_BLOCKED], end ? 0 : 1, playerData[id][SAFE_NAME], playerData[id][STEAM_ID]);
}
}

Expand Down Expand Up @@ -3077,8 +3069,8 @@ public load_skins(id)
playerId[0] = id;

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_skins` WHERE `name` = ^"%s^"", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_skins` WHERE `steamid` = ^"%s^"", playerData[id][STEAM_ID]);
case SAVE_NAME: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_skins` WHERE `name` = ^"%s^";", playerData[id][SAFE_NAME]);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "SELECT * FROM `csgo_skins` WHERE `steamid` = ^"%s^";", playerData[id][STEAM_ID]);
}

SQL_ThreadQuery(sql, "load_skins_handle", queryData, playerId, sizeof(playerId));
Expand Down Expand Up @@ -3371,8 +3363,8 @@ stock remove_skin(id, skinId, weapon[], skin[])
}
} else {
switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "UPDATE `csgo_skins` SET count = count - 1 WHERE name = ^"%s^" AND weapon = '%s' AND skin = '%s'", playerData[id][SAFE_NAME], weapon, skinSafeName);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "UPDATE `csgo_skins` SET count = count - 1 WHERE steamid = ^"%s^" AND weapon = '%s' AND skin = '%s'", playerData[id][STEAM_ID], weapon, skinSafeName);
case SAVE_NAME: formatex(queryData, charsmax(queryData), "UPDATE `csgo_skins` SET count = count - 1, steamid = ^"%s^" WHERE name = ^"%s^" AND weapon = '%s' AND skin = '%s';", playerData[id][STEAM_ID], playerData[id][SAFE_NAME], weapon, skinSafeName);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "UPDATE `csgo_skins` SET count = count - 1, name = ^"%s^" WHERE steamid = ^"%s^" AND weapon = '%s' AND skin = '%s';", playerData[id][SAFE_NAME], playerData[id][STEAM_ID], weapon, skinSafeName);
}
}

Expand All @@ -3392,8 +3384,8 @@ stock remove_active_skin(id, weapon[])
new queryData[256];

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_skins` WHERE name = ^"%s^" AND weapon = '%s ACTIVE'", playerData[id][SAFE_NAME], weapon);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_skins` WHERE steamid = ^"%s^" AND weapon = '%s ACTIVE'", playerData[id][STEAM_ID], weapon);
case SAVE_NAME: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_skins` WHERE name = ^"%s^" AND weapon = '%s ACTIVE';", playerData[id][SAFE_NAME], weapon);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "DELETE FROM `csgo_skins` WHERE steamid = ^"%s^" AND weapon = '%s ACTIVE';", playerData[id][STEAM_ID], weapon);
}

SQL_ThreadQuery(sql, "ignore_handle", queryData);
Expand All @@ -3407,10 +3399,7 @@ stock add_skin(id, skinId, weapon[], skin[])

mysql_escape_string(skin, skinSafeName, charsmax(skinSafeName));

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_skins` (`name`, `weapon`, `skin`) VALUES (^"%s^", '%s', '%s') ON DUPLICATE KEY UPDATE count = count + 1;", playerData[id][SAFE_NAME], weapon, skinSafeName);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_skins` (`steamid`, `weapon`, `skin`) VALUES (^"%s^", '%s', '%s') ON DUPLICATE KEY UPDATE count = count + 1;", playerData[id][STEAM_ID], weapon, skinSafeName);
}
formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_skins` (`name`, `steamid`, `weapon`, `skin`) VALUES (^"%s^", ^"%s^", '%s', '%s') ON DUPLICATE KEY UPDATE count = count + 1;", playerData[id][SAFE_NAME], playerData[id][STEAM_ID], weapon, skinSafeName);

SQL_ThreadQuery(sql, "ignore_handle", queryData);

Expand Down Expand Up @@ -3440,10 +3429,7 @@ stock set_skin(id, weapon[], skin[] = "", skinId = NONE, active = 0)

mysql_escape_string(skin, skinSafeName, charsmax(skinSafeName));

switch (saveType) {
case SAVE_NAME: formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_skins` (`name`, `weapon`, `skin`) VALUES (^"%s^", '%s ACTIVE', '%s');", playerData[id][SAFE_NAME], weapon, skinSafeName);
case SAVE_STEAM_ID: formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_skins` (`steamid`, `weapon`, `skin`) VALUES (^"%s^", '%s ACTIVE', '%s');", playerData[id][STEAM_ID], weapon, skinSafeName);
}
formatex(queryData, charsmax(queryData), "INSERT INTO `csgo_skins` (`name`, `steamid`, `weapon`, `skin`) VALUES (^"%s^", ^"%s^", '%s ACTIVE', '%s');", playerData[id][SAFE_NAME], playerData[id][STEAM_ID], weapon, skinSafeName);

SQL_ThreadQuery(sql, "ignore_handle", queryData);
}
Expand Down
Loading

0 comments on commit 54351db

Please sign in to comment.