Участник
Пользователь
- Сообщения
- 96
- Реакции
- 84
- Помог
- 2 раз(а)
- Ошибка
-
L 03/17/2019 - 22:35:12: [AMXX] Plugin ("poll.amxx") is setting itself as failed.
L 03/17/2019 - 22:35:12: [AMXX] Plugin says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'KY-OTAMAN', 'STEAM_0:1:225978971', 'Сменить название ссылки' at line 1
L 03/17/2019 - 22:35:12: [AMXX] Run time error 1 (plugin "poll.amxx") - forced exit
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.9.0.5236 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jan 24 2019 12:12:36
Built from: https://github.com/alliedmodders/amxmodx/commit/70d822e
Build ID: 5236:70d822e
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 09:47:42 Sep 29 2018 (1631)
Build from: https://github.com/dreamstalker/rehlds/commit/89be216
- ReGamedll
-
ReGameDLL version: 5.7.0.322-dev
Build date: 11:41:14 Jan 13 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/7398bb7
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.133 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC3 ini ANY ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.695 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5236 ini Start ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl7 ANY Never
[10] ReAPI RUN - reapi_amxx_i386.so v5.8.0.163-dev pl7 ANY Never
[11] MySQL RUN - mysql_amxx_i386.so v1.9.0.5236 pl7 ANY ANY
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5236 pl7 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5236 pl7 ANY ANY
[14] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5236 pl7 ANY ANY
[15] SxGeo RUN - sxgeo_amxx_i386.so v2.2 pl7 ANY Never
15 plugins, 15 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] Admin Loader 3.5 neygomon re_adminloader. running
[ 2] Lite Bans 2.2 neygomon lite_bans.amxx running
[ 3] ScreenMaker 1.1 neygomon screen_maker.am running
[ 4] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 5] Advanced Client Checke 0.3.6 Mistrick cmdchecker.amxx running
[ 6] amx_who 1.0 Yami Kaitou amx_who.amxx running
[ 7] ReChecker Logging 1.0 phe rc_logging.amxx running
[ 8] SF Warn Menu 0.1.4g serfreeman1337 sf_admin_warns. running
[ 9] Private Message 0.8 Denzer pm.amxx running
[ 10] Ultimate Chats Control 5.2(c) neygomon ucc.amxx running
[ 11] Maps Admin Menu 1.2.1 d3m37r4 mapsmenu.amxx running
[ 12] [ReAPI] AdminFreeLook 1.0 ReHLDS Team re_adminfreeloo running
[ 13] Invisible Spectator 1.0 ReHLDS Team re_invisible_sp running
[ 14] Lite Admin ESP 1.1 neygomon, AcE admin_esp.amxx running
[ 15] Players Menu 1.7 neugomon re_playersmenu. running
[ 16] Menus Front-End 1.5 neugomon menufront_end.a running
[ 17] CSStatsX SQL 0.7.4+1 serfreeman1337 csstatsx_sql.am running
[ 18] AES: StatsX 0.5.5 Vega serfreeman1337/s aes_statsx_cstr running
[ 19] AES: StatsX Info Rank 0.1 serfreeman1337 aes_statsx_rank running
[ 20] Say me and Say hp 1.4 reAPI neygomon re_saymehp.amxx running
[ 21] Stats Configuration 1.9.0.5236 AMXX Dev Team statscfg.amxx running
[ 22] StatsX 1.9.0.5236 AMXX Dev Team statsx.amxx running
[ 23] [ReAPI] Team Balancer 1.2 neugomon round_balancer. running
[ 24] MapBalance 0.4 mx?! MapBalance.amxx running
[ 25] GameName Changer 1.0 neugomon re_gamenamechan running
[ 26] [ReAPI] Block 'Fire in 0.0.1 sergrib re_blockfith_hu running
[ 27] [ReAPI] Flasher Punish 0.0.2b Vaqtincha re_noteamflashs running
[ 28] Fall Damage HP Restore 0.0.1 Vaqtincha re_falldmghpres running
[ 29] resetscore(ReAPI) 1.0 Phantom re_resetscore.a running
[ 30] Items Restrict Ultimat 0.0.4 Vaqtincha re_itemsrestric running
[ 31] Advertising Manager 2.0 Javekson adverts.amxx running
[ 32] Demo Recorder 2.4.0 F@nt0M demo_recorder.a running
[ 33] AFK Control 1.4.1 [Rnd neygomon re_afkcontrol.a running
[ 34] Ping Control 1.31 neygomon ping_control.am running
[ 35] Team Select 1.5.0 F@nt0M teamselect.amxx running
[ 36] Spec Money Save 0.2 F@nt0M spec_money_save running
[ 37] Simple Damager 1.0 mforce re_damager_star running
[ 38] Refill Weapon On Kill 0.0.1 Vaqtincha re_vip_vampire_ running
[ 39] Killer ScreenFade 0.0.5 Vaqtincha re_killer_scree running
[ 40] [ReAPI] Admin Models 0.0.2 Vaqtincha re_adminmodels. running
[ 41] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 42] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 43] Lite Kill Assist 1.17 neygomon kill_assist.amx running
[ 44] V.I.P Environment 2.1.1 Vaqtincha vip_environment running
[ 45] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 re_awpoff.amxx running
[ 46] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 47] In-Game Ads(MastaMan E 1.83 (Edit stupok in_game_ads.amx running
[ 48] [SxGeo] Connect Info 1.0 s1lent sxgeo_connect_i running
[ 49] Voice Flood Blocker 1.0.1 d3m37r4 voice_flood_blo running
[ 50] Announcer Killstreak 2.1 Jumper & mx?! announcer_kills running
[ 51] Advanced MUTE 2.0.0 neygomon+F@ntom re_mute_time_in running
[ 52] [ReAPI] Random Weapons 2.4.9 neugomon/h1k3 re_warmup.amxx running
[ 53] Bomb Taker 0.0.1b Vaqtincha bomb_taker.amxx running
[ 54] mp_spawnprotectiontime 0.1 wopox1337 re_spawnprotect running
[ 55] Poll 1.1 Nunfy poll.amxx running
[ 56] Map Manager: Core 3.0.4 Mistrick map_manager_cor running
[ 57] Map Manager: Scheduler 0.1.2 Mistrick map_manager_sch running
[ 58] Map Manager: Rtv 0.1.0 Mistrick map_manager_rtv running
[ 59] Map Manager: Nominatio 0.1.0 Mistrick map_manager_nom running
[ 60] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 61] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 62] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 63] Map Manager: Advanced 0.0.5 Mistrick map_manager_adv running
63 plugins, 63 running
- Автор плагина
- Nunfy
- Версия плагина
- 1.1
- Исходный код
-
#include <amxmodx>
#include <reapi>
#include <util_parser>
#include <sqlx>
#include <csstatsx_sql>
#define PLUGIN "Poll"
#define VERSION "1.1"
#define AUTHOR "Nunfy"
#define MYSQL_HOSTNAME "localhost"
#define MYSQL_USERNAME "root"
#define MYSQL_PASSWORD ""
#define MYSQL_DATABASE "up"
#define MYSQL_TABLE "table_name"
#define MAX_MENU_SIZE 512 // Максимальный размер меню
#define MAX_ITEM_LENGHT 200 // Максимальный длинна пункта меню
#define MAX_POLLS 4 // Максимальное количество опросов
#define MAX_NICKNAME_LENGHT 30 // Максимальная длинна никнейма
#define MAX_STEAM_ID_LENGHT 35 // Максимальная длинна стим ид
#define MAX_MAP_LENGHT 30 // Максимальная длинна названия карты
#define MIN_USER_GAME_TIME 900 // Минимальное время нахождения игрока на сервере(в секундах)
#define register_menu(%0,%1,%2) register_menucmd(register_menuid(%0), %1, %2)
enum user_data
{
bool: uMenu,
uPoll,
bool: uAnswered
};
static config_file_dir[] = "addons/amxmodx/configs/poll.ini"; // путь к ini файлу
new polls[MAX_POLLS][5][MAX_ITEM_LENGHT],
polls_items[MAX_POLLS],
ud[MAX_PLAYERS + 1][user_data];
new Handle: mysql_turple;
new Handle: mysql_connection;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHookChain(RG_CBasePlayer_Killed, "user_killed", true);
RegisterHookChain(RG_CSGameRules_RestartRound, "restart_round", true);
register_menu("\r[\wОпрос\r]", 1023, "main_menu_handler");
new file_id = UTIL_ParserLoadFile(config_file_dir);
for(new p; p < MAX_POLLS; p++)
{
new string[10];
format(string, charsmax(string), "[POLL_%d]", p);
console_print(0, "%s", string);
for(new i; i < UTIL_ParserGetLines(file_id, string); i++)
{
UTIL_ParserGetContent(file_id, i, polls[p][i], MAX_ITEM_LENGHT + 1, string);
polls_items[p] = i;
console_print(0, "%s", polls[p][i]);
}
}
mysql_connect();
new Handle: query = SQL_PrepareQuery(mysql_connection, "UPDATE %s SET map = ''", MYSQL_TABLE);
if(!SQL_Execute(query))
{
new error[512];
SQL_QueryError(query, error, charsmax(error));
set_fail_state(error);
}
SQL_FreeHandle(query);
}
public client_putinserver(id)
{
load_data(id);
}
public client_disconnected(id, bool:drop, message[], maxlen)
{
ud[id][uMenu] = false;
ud[id][uPoll] = 0;
ud[id][uAnswered] = false;
}
public user_killed(const this, pevAttacker, iGib)
{
if(ud[this][uAnswered] == true)
{
return;
}
else if(get_user_gametime(this) < MIN_USER_GAME_TIME)
{
return;
}
new string[MAX_MENU_SIZE], keys = MENU_KEY_7;
switch(polls_items[ud[this][uPoll]])
{
case 1:
{
format(string, charsmax(string), "\r[\wОпрос\r]\
^n^n%s\
^n^n\r7. \w%s",
polls[ud[this][uPoll]][0],
polls[ud[this][uPoll]][1]);
keys = MENU_KEY_7;
}
case 2:
{
format(string, charsmax(string), "\r[\wОпрос\r]\
^n^n%s\
^n^n\r7. \w%s\
^n\r8. \w%s",
polls[ud[this][uPoll]][0],
polls[ud[this][uPoll]][1],
polls[ud[this][uPoll]][2]);
keys = MENU_KEY_7|MENU_KEY_8;
}
case 3:
{
format(string, charsmax(string), "\r[\wОпрос\r]\
^n^n%s\
^n^n\r7. \w%s\
^n\r8. \w%s\
^n\r9. \w%s",
polls[ud[this][uPoll]][0],
polls[ud[this][uPoll]][1],
polls[ud[this][uPoll]][2],
polls[ud[this][uPoll]][3]);
keys = MENU_KEY_7|MENU_KEY_8|MENU_KEY_9;
}
case 4:
{
format(string, charsmax(string), "\r[\wОпрос\r]\
^n^n%s\
^n^n\r7. \w%s\
^n\r8. \w%s\
^n\r9. \w%s\
^n\r0. \w%s",
polls[ud[this][uPoll]][0],
polls[ud[this][uPoll]][1],
polls[ud[this][uPoll]][2],
polls[ud[this][uPoll]][3],
polls[ud[this][uPoll]][4]);
keys = MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0;
}
}
ud[this][uMenu] = true;
show_menu(this, keys, string);
}
public restart_round()
{
new users_ids[MAX_PLAYERS], users_num;
get_players(users_ids, users_num, "h");
for(new i; i < users_num; i++)
{
if(ud[users_ids[i]][uMenu] == true)
{
show_menu(users_ids[i], MENU_KEY_0, "^n", 1);
}
}
}
public main_menu_handler(id, key)
{
switch(key)
{
case 6..9:
{
ud[id][uAnswered] = true;
new nickname[MAX_NICKNAME_LENGHT + 1], steam_id[MAX_STEAM_ID_LENGHT + 1], map[MAX_MAP_LENGHT + 1];
get_user_name(id, nickname, charsmax(nickname));
get_user_authid(id, steam_id, charsmax(steam_id));
get_mapname(map, charsmax(map));
new Handle: query = SQL_PrepareQuery(mysql_connection, "INSERT INTO %s (nickname, steam_id, question, answer, next_poll_id, map) \
VALUES ('%s', '%s', '%s', '%s', '%d', '%s')",
MYSQL_TABLE,
nickname,
steam_id,
polls[ud[id][uPoll]][0],
polls[ud[id][uPoll]][key - 5],
ud[id][uPoll] + 1,
map);
if(!SQL_Execute(query))
{
new error[512];
SQL_QueryError(query, error, charsmax(error));
set_fail_state(error);
}
SQL_FreeHandle(query);
}
}
}
stock mysql_connect()
{
new error, string[512];
mysql_turple = SQL_MakeDbTuple(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE);
SQL_SetCharset(mysql_turple, "utf8");
mysql_connection = SQL_Connect(mysql_turple, error, string, charsmax(string));
if(mysql_connection == Empty_Handle)
{
set_fail_state(string);
}
}
stock load_data(id)
{
new steam_id[MAX_STEAM_ID_LENGHT + 1];
get_user_authid(id, steam_id, charsmax(steam_id));
new Handle: query = SQL_PrepareQuery(mysql_connection, "SELECT * FROM %s WHERE steam_id = '%s' AND next_poll_id = (SELECT MAX(next_poll_id) FROM %s) LIMIT 1",
MYSQL_TABLE,
steam_id,
MYSQL_TABLE);
if(!SQL_Execute(query))
{
new error[512];
SQL_QueryError(query, error, charsmax(error));
set_fail_state(error);
}
else if(SQL_NumResults(query))
{
ud[id][uPoll] = SQL_ReadResult(query, 5);
new map[MAX_MAP_LENGHT + 1];
get_mapname(map, charsmax(map));
query = SQL_PrepareQuery(mysql_connection, "SELECT * FROM %s WHERE steam_id = '%s' AND map = '%s' LIMIT 1",
MYSQL_TABLE,
steam_id,
map);
if(!SQL_Execute(query))
{
new error[512];
SQL_QueryError(query, error, charsmax(error));
set_fail_state(error);
}
else if(SQL_NumResults(query))
{
ud[id][uAnswered] = true;
}
}
SQL_FreeHandle(query);
}
Кроме этой ошибки так же заметил что в бд есть несколько записей ответа на один и тот же вопрос, от одного и того же игрока. Таких записей 30%. Стим ид одинаковый.