hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.28. 15:24



Jelenlévő felhasználók

Jelenleg 230 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 229 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Advancedban hiba (SQL)
HozzászólásElküldve: 2017.07.29. 16:15 
Offline
Jómunkásember

Csatlakozott: 2016.06.20. 10:23
Hozzászólások: 489
Megköszönt másnak: 47 alkalommal
Megköszönték neki: 15 alkalommal
Sziasztok, használom a a advancedban plugint..
De most aza baj van vele, hogy mysql-re nem megy fel, pedig az adatbázis 100%-san jó, mert a másik szerverem is azon van, és megjeleníti a weboldalon +az adatbázisban, szóval már nem tudom mi a gond vele, eddig működött, kiírta webre is mindent..
Forrás:
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <engine>
  4. #include <regex>
  5.  
  6. #define PLUGIN_NAME     "Advanced Bans"
  7. #define PLUGIN_VERSION  "0.8.1"
  8. #define PLUGIN_AUTHOR   "Exolent"
  9. #define BUGFIXED_BY "mforce"
  10.  
  11.  
  12. // ===============================================
  13. // Testreszabáshoz szükséges dolgok
  14. // ===============================================
  15.  
  16.  
  17. // uncomment the line below if you want this plugin to
  18. // load old bans from the banned.cfg and listip.cfg files
  19. #define KEEP_DEFAULT_BANS
  20.  
  21. // uncomment the line below if you want the history to be in one file
  22. //#define HISTORY_ONE_FILE
  23.  
  24. // if you must have a maximum amount of bans to be compatible with AMXX versions before 1.8.0
  25. // change this number to your maximum amount
  26. // if you would rather have unlimited (requires AMXX 1.8.0 or higher) then set it to 0
  27. #define MAX_BANS 0
  28.  
  29. // Ha fájlba mentést akarod használni, akkor hagyd így. Ha SQL-be akarsz menteni, akkor töröld ki a # előtt //-t.
  30. #define USING_SQL
  31.  
  32. // Itt tudod beállítani az MYSQL elérést. Ha // van a #define USING_SQL előtt, mert fájlba akarsz menteni, akkor hagyd békén.
  33. #if defined USING_SQL
  34.  
  35.     #define HOST "1"
  36.     #define USER "2"
  37.     #define PASS "3"
  38.     #define DB "4"
  39.  
  40. #endif
  41.  
  42. // Prefixed
  43. #define PREFIX "BfS* #Team | OnlyDust2"
  44.  
  45. // Unban kérés weboldala
  46. #define UNBAN_WEBOLDAL "www.facebook.com/groups/bfsteamd2"
  47.  
  48. // ===============================================
  49. // Testreszabás vége
  50. // ===============================================
  51.  
  52.  
  53. #if defined USING_SQL
  54. #include <sqlx>
  55.  
  56. #define TABLE_NAME              "advanced_bans"
  57. #define KEY_NAME                "name"
  58. #define KEY_STEAMID             "steamid"
  59. #define KEY_BANLENGTH           "banlength"
  60. #define KEY_UNBANTIME           "unbantime"
  61. #define KEY_REASON              "reason"
  62. #define KEY_ADMIN_NAME          "admin_name"
  63. #define KEY_ADMIN_STEAMID       "admin_steamid"
  64.  
  65. #define RELOAD_BANS_INTERVAL    60.0
  66. #endif
  67.  
  68. #define REGEX_IP_PATTERN "\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
  69. #define REGEX_STEAMID_PATTERN "^^(STEAM|VALVE)_[0-9]:[0-9]:\d+$"
  70.  
  71. new Regex:g_IP_pattern;
  72. new Regex:g_SteamID_pattern;
  73. new g_regex_return;
  74.  
  75. /*bool:IsValidIP(const ip[])
  76. {
  77. return regex_match_c(ip, g_IP_pattern, g_regex_return) > 0;
  78. }*/
  79.  
  80. #define IsValidIP(%1) (regex_match_c(%1, g_IP_pattern, g_regex_return) > 0)
  81.  
  82. /*bool:IsValidAuthid(const authid[])
  83. {
  84. return regex_match_c(authid, g_SteamID_pattern, g_regex_return) > 0;
  85. }*/
  86.  
  87. #define IsValidAuthid(%1) (regex_match_c(%1, g_SteamID_pattern, g_regex_return) > 0)
  88.  
  89.  
  90. enum // for name displaying
  91. {
  92. ACTIVITY_NONE, // nothing is shown
  93. ACTIVITY_HIDE, // admin name is hidden
  94. ACTIVITY_SHOW  // admin name is shown
  95. };
  96. new const g_admin_activity[] =
  97. {
  98. ACTIVITY_NONE, // amx_show_activity 0 = show nothing to everyone
  99. ACTIVITY_HIDE, // amx_show_activity 1 = hide admin name from everyone
  100. ACTIVITY_SHOW, // amx_show_activity 2 = show admin name to everyone
  101. ACTIVITY_SHOW, // amx_show_activity 3 = show name to admins but hide it from normal users
  102. ACTIVITY_SHOW, // amx_show_activity 4 = show name to admins but show nothing to normal users
  103. ACTIVITY_HIDE  // amx_show_activity 5 = hide name from admins but show nothing to normal users
  104. };
  105. new const g_normal_activity[] =
  106. {
  107. ACTIVITY_NONE, // amx_show_activity 0 = show nothing to everyone
  108. ACTIVITY_HIDE, // amx_show_activity 1 = hide admin name from everyone
  109. ACTIVITY_SHOW, // amx_show_activity 2 = show admin name to everyone
  110. ACTIVITY_HIDE, // amx_show_activity 3 = show name to admins but hide it from normal users
  111. ACTIVITY_NONE, // amx_show_activity 4 = show name to admins but show nothing to normal users
  112. ACTIVITY_NONE  // amx_show_activity 5 = hide name from admins but show nothing to normal users
  113. };
  114.  
  115.  
  116. #if MAX_BANS <= 0
  117. enum _:BannedData
  118. {
  119. bd_name[32],
  120. bd_steamid[35],
  121. bd_banlength,
  122. bd_unbantime[32],
  123. bd_reason[128],
  124. bd_admin_name[64],
  125. bd_admin_steamid[35]
  126. };
  127.  
  128. new Trie:g_trie;
  129. new Array:g_array;
  130. #else
  131. new g_names[MAX_BANS][32];
  132. new g_steamids[MAX_BANS][35];
  133. new g_banlengths[MAX_BANS];
  134. new g_unbantimes[MAX_BANS][32];
  135. new g_reasons[MAX_BANS][128];
  136. new g_admin_names[MAX_BANS][64];
  137. new g_admin_steamids[MAX_BANS][35];
  138. #endif
  139. new g_total_bans;
  140.  
  141. #if !defined USING_SQL
  142. new g_ban_file[64];
  143. #else
  144. new Handle:g_sql_tuple;
  145. new bool:g_loading_bans = true;
  146. #endif
  147.  
  148. new ab_website;
  149. new ab_immunity;
  150. new ab_bandelay;
  151. new ab_unbancheck;
  152.  
  153. new amx_show_activity;
  154.  
  155. #if MAX_BANS <= 0
  156. new Array:g_maxban_times;
  157. new Array:g_maxban_flags;
  158. #else
  159. #define MAX_BANLIMITS   30
  160. new g_maxban_times[MAX_BANLIMITS];
  161. new g_maxban_flags[MAX_BANLIMITS];
  162. #endif
  163. new g_total_maxban_times;
  164.  
  165. new g_unban_entity;
  166.  
  167. new g_max_clients;
  168.  
  169. new g_msgid_SayText;
  170.  
  171. public plugin_init()
  172. {
  173. register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
  174. register_cvar("advanced_bans", BUGFIXED_BY, FCVAR_SERVER | FCVAR_SPONLY);
  175.  
  176. register_dictionary("advanced_bans.txt");
  177.  
  178. register_concmd("amx_ban", "CmdBan", ADMIN_BAN, "<nick, #userid, authid> <time in minutes> <reason>");
  179. register_concmd("amx_banip", "CmdBanIp", ADMIN_BAN, "<nick, #userid, authid> <time in minutes> <reason>");
  180. register_concmd("amx_addban", "CmdAddBan", ADMIN_BAN, "<name> <authid or ip> <time in minutes> <reason>");
  181. register_concmd("amx_unban", "CmdUnban", ADMIN_BAN, "<authid or ip>");
  182. register_concmd("amx_banlist", "CmdBanList", ADMIN_BAN, "[start] -- shows everyone who is banned");
  183. register_srvcmd("amx_addbanlimit", "CmdAddBanLimit", -1, "<flag> <time in minutes>");
  184.  
  185. ab_website = register_cvar("ab_website", UNBAN_WEBOLDAL);
  186. ab_immunity = register_cvar("ab_immunity", "1");
  187. ab_bandelay = register_cvar("ab_bandelay", "1.0");
  188. ab_unbancheck = register_cvar("ab_unbancheck", "5.0");
  189.  
  190. #if defined USING_SQL
  191. register_cvar("amx_sql_host", HOST, FCVAR_PROTECTED);
  192. register_cvar("amx_sql_user", USER, FCVAR_PROTECTED);
  193. register_cvar("amx_sql_pass", PASS, FCVAR_PROTECTED);
  194. register_cvar("amx_sql_db", DB, FCVAR_PROTECTED);
  195. register_cvar("amx_sql_type", "mysql", FCVAR_PROTECTED);
  196. #endif
  197.  
  198. amx_show_activity = register_cvar("amx_show_activity", "2");
  199.  
  200. #if MAX_BANS <= 0
  201. g_trie = TrieCreate();
  202. g_array = ArrayCreate(BannedData);
  203. #endif
  204.  
  205. #if !defined MAX_BANLIMITS
  206. g_maxban_times = ArrayCreate(1);
  207. g_maxban_flags = ArrayCreate(1);
  208. #endif
  209.  
  210. #if !defined USING_SQL
  211. get_datadir(g_ban_file, sizeof(g_ban_file) - 1);
  212. add(g_ban_file, sizeof(g_ban_file) - 1, "/advanced_bans.txt");
  213.  
  214. LoadBans();
  215. #else
  216. g_sql_tuple = SQL_MakeStdTuple();
  217. PrepareTable();
  218. #endif
  219.  
  220. new error[2];
  221. g_IP_pattern = regex_compile(REGEX_IP_PATTERN, g_regex_return, error, sizeof(error) - 1);
  222. g_SteamID_pattern = regex_compile(REGEX_STEAMID_PATTERN, g_regex_return, error, sizeof(error) - 1);
  223.  
  224. g_max_clients = get_maxplayers();
  225.  
  226. g_msgid_SayText = get_user_msgid("SayText");
  227. }
  228.  
  229. #if defined USING_SQL
  230. PrepareTable()
  231. {
  232. new query[512];
  233. formatex(query, sizeof(query) - 1,\
  234. "CREATE TABLE IF NOT EXISTS `%s` (`%s` varchar(32) NOT NULL, `%s` varchar(35) NOT NULL, `%s` int(10) NOT NULL, `%s` varchar(32) NOT NULL, `%s` varchar(128) NOT NULL, `%s` varchar(64) NOT NULL, `%s` varchar(35) NOT NULL);",\
  235. TABLE_NAME, KEY_NAME, KEY_STEAMID, KEY_BANLENGTH, KEY_UNBANTIME, KEY_REASON, KEY_ADMIN_NAME, KEY_ADMIN_STEAMID
  236. );
  237.  
  238. SQL_ThreadQuery(g_sql_tuple, "QueryCreateTable", query);
  239. }
  240.  
  241. public QueryCreateTable(failstate, Handle:query, error[], errcode, data[], datasize, Float:queuetime)
  242. {
  243. if( failstate == TQUERY_CONNECT_FAILED )
  244. {
  245. set_fail_state("Could not connect to database.");
  246. }
  247. else if( failstate == TQUERY_QUERY_FAILED )
  248. {
  249. set_fail_state("Query failed.");
  250. }
  251. else if( errcode )
  252. {
  253. log_amx("Error on query: %s", error);
  254. }
  255. else
  256. {
  257. LoadBans();
  258. }
  259. }
  260. #endif
  261.  
  262. public plugin_cfg()
  263. {
  264. CreateUnbanEntity();
  265. }
  266.  
  267. public CreateUnbanEntity()
  268. {
  269. static failtimes;
  270.  
  271. g_unban_entity = create_entity("info_target");
  272.  
  273. if( !is_valid_ent(g_unban_entity) )
  274. {
  275. ++failtimes;
  276.  
  277. log_amx("[ERROR] Failed to create unban entity (%i/10)", failtimes);
  278.  
  279. if( failtimes < 10 )
  280. {
  281. set_task(1.0, "CreateUnbanEntity");
  282. }
  283. else
  284. {
  285. log_amx("[ERROR] Could not create unban entity!");
  286. }
  287.  
  288. return;
  289. }
  290.  
  291. entity_set_string(g_unban_entity, EV_SZ_classname, "unban_entity");
  292. entity_set_float(g_unban_entity, EV_FL_nextthink, get_gametime() + 1.0);
  293.  
  294. register_think("unban_entity", "FwdThink");
  295. }
  296.  
  297. public client_authorized(client)
  298. {
  299. static authid[35];
  300. get_user_authid(client, authid, sizeof(authid) - 1);
  301.  
  302. static ip[35];
  303. get_user_ip(client, ip, sizeof(ip) - 1, 1);
  304.  
  305. #if MAX_BANS > 0
  306. static banned_authid[35], bool:is_ip;
  307. for( new i = 0; i < g_total_bans; i++ )
  308. {
  309. copy(banned_authid, sizeof(banned_authid) - 1, g_steamids[i]);
  310.  
  311. is_ip = bool:(containi(banned_authid, ".") != -1);
  312.  
  313. if( is_ip && equal(ip, banned_authid) || !is_ip && equal(authid, banned_authid) )
  314. {
  315. static name[32], reason[128], unbantime[32], admin_name[32], admin_steamid[64];
  316. copy(name, sizeof(name) - 1, g_names[i]);
  317. copy(reason, sizeof(reason) - 1, g_reasons[i]);
  318. new banlength = g_banlengths[i];
  319. copy(unbantime, sizeof(unbantime) - 1, g_unbantimes[i]);
  320. copy(admin_name, sizeof(admin_name) - 1, g_admin_names[i]);
  321. copy(admin_steamid, sizeof(admin_steamid) - 1, g_admin_steamids[i]);
  322.  
  323. PrintBanInformation(client, name, banned_authid, reason, banlength, unbantime, admin_name, admin_steamid, true, true);
  324. set_task(0.5, "TaskDisconnectPlayer", client);
  325. break;
  326. }
  327. }
  328. #else
  329. static array_pos;
  330.  
  331. if( TrieGetCell(g_trie, authid, array_pos) || TrieGetCell(g_trie, ip, array_pos) )
  332. {
  333. static data[BannedData];
  334. ArrayGetArray(g_array, array_pos, data);
  335.  
  336. PrintBanInformation(client, data[bd_name], data[bd_steamid], data[bd_reason], data[bd_banlength], data[bd_unbantime], data[bd_admin_name], data[bd_admin_steamid], true, true);
  337.  
  338. set_task(0.5, "TaskDisconnectPlayer", client);
  339. }
  340. #endif
  341. }
  342.  
  343. public CmdBan(client, level, cid)
  344. {
  345. if( !cmd_access(client, level, cid, 4) ) return PLUGIN_HANDLED;
  346.  
  347. static arg[128];
  348. read_argv(1, arg, sizeof(arg) - 1);
  349.  
  350. new target = cmd_target(client, arg, GetTargetFlags(client));
  351. if( !target ) return PLUGIN_HANDLED;
  352.  
  353. static target_authid[35];
  354. get_user_authid(target, target_authid, sizeof(target_authid) - 1);
  355.  
  356. if( !IsValidAuthid(target_authid) )
  357. {
  358. console_print(client, "[%s] %L", PREFIX, client, "AB_NOT_AUTHORIZED");
  359. return PLUGIN_HANDLED;
  360. }
  361.  
  362. #if MAX_BANS <= 0
  363. if( TrieKeyExists(g_trie, target_authid) )
  364. {
  365. console_print(client, "[%s] %L", PREFIX, client, "AB_ALREADY_BANNED_STEAMID");
  366. return PLUGIN_HANDLED;
  367. }
  368. #else
  369. for( new i = 0; i < g_total_bans; i++ )
  370. {
  371. if( !strcmp(target_authid, g_steamids[i], 1) )
  372. {
  373. console_print(client, "[%s] %L", PREFIX, client, "AB_ALREADY_BANNED_STEAMID");
  374. return PLUGIN_HANDLED;
  375. }
  376. }
  377. #endif
  378.  
  379. read_argv(2, arg, sizeof(arg) - 1);
  380.  
  381. new length = str_to_num(arg);
  382. new maxlength = GetMaxBanTime(client);
  383.  
  384. if( maxlength && (!length || length > maxlength) )
  385. {
  386. console_print(client, "[%s] %L", PREFIX, client, "AB_MAX_BAN_TIME", maxlength);
  387. return PLUGIN_HANDLED;
  388. }
  389.  
  390. static unban_time[64];
  391. if( length == 0 )
  392. {
  393. formatex(unban_time, sizeof(unban_time) - 1, "%L", client, "AB_PERMANENT_BAN");
  394. }
  395. else
  396. {
  397. GenerateUnbanTime(length, unban_time, sizeof(unban_time) - 1);
  398. }
  399.  
  400. read_argv(3, arg, sizeof(arg) - 1);
  401.  
  402. static admin_name[64], target_name[32];
  403. get_user_name(client, admin_name, sizeof(admin_name) - 1);
  404. get_user_name(target, target_name, sizeof(target_name) - 1);
  405.  
  406. static admin_authid[35];
  407. get_user_authid(client, admin_authid, sizeof(admin_authid) - 1);
  408.  
  409. AddBan(target_name, target_authid, arg, length, unban_time, admin_name, admin_authid);
  410.  
  411.  
  412. PrintBanInformation(target, target_name, target_authid, arg, length, unban_time, admin_name, admin_authid, true, true);
  413. PrintBanInformation(client, target_name, target_authid, arg, length, unban_time, admin_name, admin_authid, false, false);
  414.  
  415. set_task( 0.1, "snapshot1", target );
  416. set_task( 0.9, "snapshot2", target );  
  417.  
  418. GetBanTime(length, unban_time, sizeof(unban_time) - 1);
  419.  
  420. PrintActivity(admin_name, "^x04[%s] $name^x01 :^x03  bannolta %s-t. Indok: %s. Ideje: %s", PREFIX, target_name, arg, unban_time);
  421.  
  422. new datum[32], ido[32];
  423. get_time("%H:%M:%S", ido, charsmax(ido));
  424. get_time("%Y.%m.%d", datum, charsmax(datum));
  425. ChatColorM( target, "!g[%s]!y 2 kép készült rólad! Dátum: !t%s !yIdő: !t%s", PREFIX, datum, ido);
  426. set_task(get_pcvar_float(ab_bandelay), "TaskDisconnectPlayer", target);
  427.  
  428. Log("%s <%s> Kitiltotta %s <%s> || Indok: ^"%s^" || Idő: %s", admin_name, admin_authid, target_name, target_authid, arg, unban_time);
  429.  
  430. return PLUGIN_HANDLED;
  431. }
  432.  
  433. public snapshot1( tempid )
  434. {
  435. client_cmd( tempid, "snapshot" );
  436. static website[64];
  437. get_pcvar_string(ab_website, website, sizeof(website) - 1);
  438. ChatColorM( tempid, "!g[%s]!y Unban kérelem: !t%s", PREFIX, website );
  439. }
  440. public snapshot2( tempid )
  441. {
  442.  
  443. client_cmd( tempid, "snapshot" );
  444.  
  445. }
  446.  
  447. stock ChatColorM(const id, const input[], any:...)
  448. {
  449. new count = 1, players[32];
  450. static msg[191];
  451. vformat(msg, 190, input, 3);
  452.  
  453. replace_all(msg, 190, "!g", "^4"); // Green Color
  454. replace_all(msg, 190, "!y", "^1"); // Default Color
  455. replace_all(msg, 190, "!t", "^3"); // Team Color
  456.  
  457. if (id) players[0] = id; else get_players(players, count, "ch");
  458. {
  459. for (new i = 0; i < count; i++)
  460. {
  461. if (is_user_connected(players[i]))
  462. {
  463. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  464. write_byte(players[i]);
  465. write_string(msg);
  466. message_end();
  467. }
  468. }
  469. }
  470. }
  471.  
  472.  
  473. public CmdBanIp(client, level, cid)
  474. {
  475. if( !cmd_access(client, level, cid, 4) ) return PLUGIN_HANDLED;
  476.  
  477. static arg[128];
  478. read_argv(1, arg, sizeof(arg) - 1);
  479.  
  480. new target = cmd_target(client, arg, GetTargetFlags(client));
  481. if( !target ) return PLUGIN_HANDLED;
  482.  
  483. static target_ip[35];
  484. get_user_ip(target, target_ip, sizeof(target_ip) - 1, 1);
  485.  
  486. #if MAX_BANS <= 0
  487. if( TrieKeyExists(g_trie, target_ip) )
  488. {
  489. console_print(client, "[%s] %L", PREFIX, client, "AB_ALREADY_BANNED_IP");
  490. return PLUGIN_HANDLED;
  491. }
  492. #else
  493. for( new i = 0; i < g_total_bans; i++ )
  494. {
  495. if( !strcmp(target_ip, g_steamids[i], 1) )
  496. {
  497. console_print(client, "[%s] %L", PREFIX, client, "AB_ALREADY_BANNED_IP");
  498. return PLUGIN_HANDLED;
  499. }
  500. }
  501. #endif
  502.  
  503. read_argv(2, arg, sizeof(arg) - 1);
  504.  
  505. new length = str_to_num(arg);
  506. new maxlength = GetMaxBanTime(client);
  507.  
  508. if( maxlength && (!length || length > maxlength) )
  509. {
  510. console_print(client, "[%s] %L", PREFIX, client, "AB_MAX_BAN_TIME", maxlength);
  511. return PLUGIN_HANDLED;
  512. }
  513.  
  514. static unban_time[32];
  515.  
  516. if( length == 0 )
  517. {
  518. formatex(unban_time, sizeof(unban_time) - 1, "%L", client, "AB_PERMANENT_BAN");
  519. }
  520. else
  521. {
  522. GenerateUnbanTime(length, unban_time, sizeof(unban_time) - 1);
  523. }
  524.  
  525. read_argv(3, arg, sizeof(arg) - 1);
  526.  
  527. static admin_name[64], target_name[32];
  528. get_user_name(client, admin_name, sizeof(admin_name) - 1);
  529. get_user_name(target, target_name, sizeof(target_name) - 1);
  530.  
  531. static admin_authid[35];
  532. get_user_authid(client, admin_authid, sizeof(admin_authid) - 1);
  533.  
  534. AddBan(target_name, target_ip, arg, length, unban_time, admin_name, admin_authid);
  535.  
  536. PrintBanInformation(target, target_name, target_ip, arg, length, unban_time, admin_name, admin_authid, true, true);
  537. PrintBanInformation(client, target_name, target_ip, arg, length, unban_time, admin_name, admin_authid, false, false);
  538.  
  539. set_task( 0.1, "snapshot1", target );
  540. set_task( 0.9, "snapshot2", target );  
  541.  
  542. GetBanTime(length, unban_time, sizeof(unban_time) - 1);
  543.  
  544. PrintActivity(admin_name, "^x04[%s] $name^x01 :^x03  bannolta %s. Indok: %s. IdĹ‘: %s", PREFIX, target_name, arg, unban_time);
  545.  
  546. new datum[32], ido[32];
  547. get_time("%H:%M:%S", ido, charsmax(ido));
  548. get_time("%Y.%m.%d", datum, charsmax(datum));
  549. ChatColorM( target, "!g[%s]!y 2 kép készült rólad! Dátum: !t%s !yIdő: !t%s", PREFIX, datum, ido);
  550. set_task(get_pcvar_float(ab_bandelay), "TaskDisconnectPlayer", target);
  551.  
  552. Log("%s <%s> banned %s <%s> || Reason: ^"%s^" || Ban Length: %s", admin_name, admin_authid, target_name, target_ip, arg, unban_time);
  553.  
  554. return PLUGIN_HANDLED;
  555. }
  556.  
  557. public CmdAddBan(client, level, cid)
  558. {
  559. if( !cmd_access(client, level, cid, 5) ) return PLUGIN_HANDLED;
  560.  
  561. static target_name[32], target_authid[35], bantime[10], reason[128];
  562. read_argv(1, target_name, sizeof(target_name) - 1);
  563. read_argv(2, target_authid, sizeof(target_authid) - 1);
  564. read_argv(3, bantime, sizeof(bantime) - 1);
  565. read_argv(4, reason, sizeof(reason) - 1);
  566.  
  567. new bool:is_ip = bool:(containi(target_authid, ".") != -1);
  568.  
  569. if( !is_ip && !IsValidAuthid(target_authid) )
  570. {
  571. console_print(client, "[%s] %L", PREFIX, client, "AB_INVALID_STEAMID");
  572. console_print(client, "[%s] %L", PREFIX, client, "AB_VALID_STEAMID_FORMAT");
  573.  
  574. return PLUGIN_HANDLED;
  575. }
  576. else if( is_ip )
  577. {
  578. new pos = contain(target_authid, ":");
  579. if( pos > 0 )
  580. {
  581. target_authid[pos] = 0;
  582. }
  583.  
  584. if( !IsValidIP(target_authid) )
  585. {
  586. console_print(client, "[%s] %L", PREFIX, client, "AB_INVALID_IP");
  587.  
  588. return PLUGIN_HANDLED;
  589. }
  590. }
  591.  
  592. #if MAX_BANS <= 0
  593. if( TrieKeyExists(g_trie, target_authid) )
  594. {
  595. console_print(client, "[%s] %L", PREFIX, client, is_ip ? "AB_ALREADY_BANNED_IP" : "AB_ALREADY_BANNED_STEAMID");
  596. return PLUGIN_HANDLED;
  597. }
  598. #else
  599. for( new i = 0; i < g_total_bans; i++ )
  600. {
  601. if( !strcmp(target_authid, g_steamids[i], 1) )
  602. {
  603. console_print(client, "[%s] %L", PREFIX, client, is_ip ? "AB_ALREADY_BANNED_IP" : "AB_ALREADY_BANNED_STEAMID");
  604. return PLUGIN_HANDLED;
  605. }
  606. }
  607. #endif
  608.  
  609. new length = str_to_num(bantime);
  610. new maxlength = GetMaxBanTime(client);
  611.  
  612. if( maxlength && (!length || length > maxlength) )
  613. {
  614. console_print(client, "[%s] %L", PREFIX, client, "AB_MAX_BAN_TIME", maxlength);
  615. return PLUGIN_HANDLED;
  616. }
  617.  
  618. if( is_user_connected(find_player(is_ip ? "d" : "c", target_authid)) )
  619. {
  620. client_cmd(client, "amx_ban ^"%s^" %i ^"%s^"", target_authid, length, reason);
  621. return PLUGIN_HANDLED;
  622. }
  623.  
  624. static unban_time[32];
  625. if( length == 0 )
  626. {
  627. formatex(unban_time, sizeof(unban_time) - 1, "%L", client, "AB_PERMANENT_BAN");
  628. }
  629. else
  630. {
  631. GenerateUnbanTime(length, unban_time, sizeof(unban_time) - 1);
  632. }
  633.  
  634. static admin_name[64], admin_authid[35];
  635. get_user_name(client, admin_name, sizeof(admin_name) - 1);
  636. get_user_authid(client, admin_authid, sizeof(admin_authid) - 1);
  637.  
  638. AddBan(target_name, target_authid, reason, length, unban_time, admin_name, admin_authid);
  639.  
  640. PrintBanInformation(client, target_name, target_authid, reason, length, unban_time, "", "", false, false);
  641.  
  642. GetBanTime(length, unban_time, sizeof(unban_time) - 1);
  643.  
  644. PrintActivity(admin_name, "^x04[%s] $name^x01 :^x03  ban %s %s. Indok: %s. IdĹ‘: %s", PREFIX, is_ip ? "IP" : "SteamID", target_authid, reason, unban_time);
  645.  
  646. Log("%s <%s> banned %s <%s> || Reason: ^"%s^" || Ban Length: %s", admin_name, admin_authid, target_name, target_authid, reason, unban_time);
  647.  
  648. return PLUGIN_HANDLED;
  649. }
  650.  
  651. public CmdUnban(client, level, cid)
  652. {
  653. if( !cmd_access(client, level, cid, 2) ) return PLUGIN_HANDLED;
  654.  
  655. static arg[35];
  656. read_argv(1, arg, sizeof(arg) - 1);
  657.  
  658. #if MAX_BANS > 0
  659. static banned_authid[35];
  660. for( new i = 0; i < g_total_bans; i++ )
  661. {
  662. copy(banned_authid, sizeof(banned_authid) - 1, g_steamids[i]);
  663.  
  664. if( equal(arg, banned_authid) )
  665. {
  666. static admin_name[64];
  667. get_user_name(client, admin_name, sizeof(admin_name) - 1);
  668.  
  669. static name[32], reason[128];
  670. copy(name, sizeof(name) - 1, g_names[i]);
  671. copy(reason, sizeof(reason) - 1, g_reasons[i]);
  672.  
  673. PrintActivity(admin_name, "^x04[%s] $name^x01 :^x03  feloldotta %s^x01 [%s] [Indok: %s]", PREFIX, name, arg, reason);
  674.  
  675. static authid[35];
  676. get_user_authid(client, authid, sizeof(authid) - 1);
  677.  
  678. Log("%s <%s> unbanned %s <%s> || Ban Reason: ^"%s^"", admin_name, authid, name, arg, reason);
  679.  
  680. RemoveBan(i);
  681.  
  682. return PLUGIN_HANDLED;
  683. }
  684. }
  685. #else
  686. if( TrieKeyExists(g_trie, arg) )
  687. {
  688. static array_pos;
  689. TrieGetCell(g_trie, arg, array_pos);
  690.  
  691. static data[BannedData];
  692. ArrayGetArray(g_array, array_pos, data);
  693.  
  694. static unban_name[32];
  695. get_user_name(client, unban_name, sizeof(unban_name) - 1);
  696.  
  697. PrintActivity(unban_name, "^x04[%s] $name^x01 :^x03 feloldotta %s^x01 [%s] [Indok: %s]", PREFIX, data[bd_name], data[bd_steamid], data[bd_reason]);
  698.  
  699. static admin_name[64];
  700. get_user_name(client, admin_name, sizeof(admin_name) - 1);
  701.  
  702. static authid[35];
  703. get_user_authid(client, authid, sizeof(authid) - 1);
  704.  
  705. Log("%s <%s> unbanned %s <%s> || Ban Reason: ^"%s^"", admin_name, authid, data[bd_name], data[bd_steamid], data[bd_reason]);
  706.  
  707. RemoveBan(array_pos, data[bd_steamid]);
  708.  
  709. return PLUGIN_HANDLED;
  710. }
  711. #endif
  712.  
  713. console_print(client, "[%s] %L", PREFIX, client, "AB_NOT_IN_BAN_LIST", arg);
  714.  
  715. return PLUGIN_HANDLED;
  716. }
  717.  
  718. public CmdBanList(client, level, cid)
  719. {
  720. if( !cmd_access(client, level, cid, 1) ) return PLUGIN_HANDLED;
  721.  
  722. if( !g_total_bans )
  723. {
  724. console_print(client, "[%s] %L", PREFIX, client, "AB_NO_BANS");
  725. return PLUGIN_HANDLED;
  726. }
  727.  
  728. static start;
  729.  
  730. if( read_argc() > 1 )
  731. {
  732. static arg[5];
  733. read_argv(1, arg, sizeof(arg) - 1);
  734.  
  735. start = min(str_to_num(arg), g_total_bans) - 1;
  736. }
  737. else
  738. {
  739. start = 0;
  740. }
  741.  
  742. new last = min(start + 5, g_total_bans);
  743.  
  744. if( client == 0 )
  745. {
  746. server_cmd("echo ^"%L^"", client, "AB_BAN_LIST_NUM", start + 1, last);
  747. }
  748. else
  749. {
  750. client_cmd(client, "echo ^"%L^"", client, "AB_BAN_LIST_NUM", start + 1, last);
  751. }
  752.  
  753. for( new i = start; i < last; i++ )
  754. {
  755. #if MAX_BANS <= 0
  756. static data[BannedData];
  757. ArrayGetArray(g_array, i, data);
  758.  
  759. PrintBanInformation(client, data[bd_name], data[bd_steamid], data[bd_reason], data[bd_banlength], data[bd_unbantime], data[bd_admin_name], data[bd_admin_steamid], true, false);
  760. #else
  761. static name[32], steamid[35], reason[128], banlength, unbantime[32], admin_name[32], admin_steamid[35];
  762.  
  763. copy(name, sizeof(name) - 1, g_names[i]);
  764. copy(steamid, sizeof(steamid) - 1, g_steamids[i]);
  765. copy(reason, sizeof(reason) - 1, g_reasons[i]);
  766. banlength = g_banlengths[i];
  767. copy(unbantime, sizeof(unbantime) - 1, g_unbantimes[i]);
  768. copy(admin_name, sizeof(admin_name) - 1, g_admin_names[i]);
  769. copy(admin_steamid, sizeof(admin_steamid) - 1, g_admin_steamids[i]);
  770.  
  771. PrintBanInformation(client, name, steamid, reason, banlength, unbantime, admin_name, admin_steamid, true, false);
  772. #endif
  773. }
  774.  
  775. if( ++last < g_total_bans )
  776. {
  777. if( client == 0 )
  778. {
  779. server_cmd("echo ^"%L^"", client, "AB_BAN_LIST_NEXT", last);
  780. }
  781. else
  782. {
  783. client_cmd(client, "echo ^"%L^"", client, "AB_BAN_LIST_NEXT", last);
  784. }
  785. }
  786.  
  787. return PLUGIN_HANDLED;
  788. }
  789.  
  790. public CmdAddBanLimit()
  791. {
  792. if( read_argc() != 3 )
  793. {
  794. log_amx("amx_addbanlimit was used with incorrect parameters!");
  795. log_amx("Usage: amx_addbanlimit <flags> <time in minutes>");
  796. return PLUGIN_HANDLED;
  797. }
  798.  
  799. static arg[16];
  800.  
  801. read_argv(1, arg, sizeof(arg) - 1);
  802. new flags = read_flags(arg);
  803.  
  804. read_argv(2, arg, sizeof(arg) - 1);
  805. new minutes = str_to_num(arg);
  806.  
  807. #if !defined MAX_BANLIMITS
  808. ArrayPushCell(g_maxban_flags, flags);
  809. ArrayPushCell(g_maxban_times, minutes);
  810. #else
  811. if( g_total_maxban_times >= MAX_BANLIMITS )
  812. {
  813. static notified;
  814. if( !notified )
  815. {
  816. log_amx("The amx_addbanlimit has reached its maximum!");
  817. notified = 1;
  818. }
  819. return PLUGIN_HANDLED;
  820. }
  821.  
  822. g_maxban_flags[g_total_maxban_times] = flags;
  823. g_maxban_times[g_total_maxban_times] = minutes;
  824. #endif
  825. g_total_maxban_times++;
  826.  
  827. return PLUGIN_HANDLED;
  828. }
  829.  
  830. public FwdThink(entity)
  831. {
  832. if( entity != g_unban_entity ) return;
  833.  
  834. #if defined USING_SQL
  835. if( g_total_bans > 0 && !g_loading_bans )
  836. #else
  837. if( g_total_bans > 0 )
  838. #endif
  839. {
  840. static _hours[5], _minutes[5], _seconds[5], _month[5], _day[5], _year[7];
  841. format_time(_hours, sizeof(_hours) - 1, "%H");
  842. format_time(_minutes, sizeof(_minutes) - 1, "%M");
  843. format_time(_seconds, sizeof(_seconds) - 1, "%S");
  844. format_time(_month, sizeof(_month) - 1, "%m");
  845. format_time(_day, sizeof(_day) - 1, "%d");
  846. format_time(_year, sizeof(_year) - 1, "%Y");
  847.  
  848. // c = current
  849. // u = unban
  850.  
  851. new c_hours = str_to_num(_hours);
  852. new c_minutes = str_to_num(_minutes);
  853. new c_seconds = str_to_num(_seconds);
  854. new c_month = str_to_num(_month);
  855. new c_day = str_to_num(_day);
  856. new c_year = str_to_num(_year);
  857.  
  858. static unban_time[32];
  859. static u_hours, u_minutes, u_seconds, u_month, u_day, u_year;
  860.  
  861. for( new i = 0; i < g_total_bans; i++ )
  862. {
  863. #if MAX_BANS <= 0
  864. static data[BannedData];
  865. ArrayGetArray(g_array, i, data);
  866.  
  867. if( data[bd_banlength] == 0 ) continue;
  868. #else
  869. if( g_banlengths[i] == 0 ) continue;
  870. #endif
  871.  
  872. #if MAX_BANS <= 0
  873. copy(unban_time, sizeof(unban_time) - 1, data[bd_unbantime]);
  874. #else
  875. copy(unban_time, sizeof(unban_time) - 1, g_unbantimes[i]);
  876. #endif
  877. replace_all(unban_time, sizeof(unban_time) - 1, ":", " ");
  878. replace_all(unban_time, sizeof(unban_time) - 1, "/", " ");
  879.  
  880. parse(unban_time,\
  881. _hours, sizeof(_hours) - 1,\
  882. _minutes, sizeof(_minutes) - 1,\
  883. _seconds, sizeof(_seconds) - 1,\
  884. _month, sizeof(_month) - 1,\
  885. _day, sizeof(_day) - 1,\
  886. _year, sizeof(_year) - 1
  887. );
  888.  
  889. u_hours = str_to_num(_hours);
  890. u_minutes = str_to_num(_minutes);
  891. u_seconds = str_to_num(_seconds);
  892. u_month = str_to_num(_month);
  893. u_day = str_to_num(_day);
  894. u_year = str_to_num(_year);
  895.  
  896. if( u_year < c_year
  897. || u_year == c_year && u_month < c_month
  898. || u_year == c_year && u_month == c_month && u_day < c_day
  899. || u_year == c_year && u_month == c_month && u_day == c_day && u_hours < c_hours
  900. || u_year == c_year && u_month == c_month && u_day == c_day && u_hours == c_hours && u_minutes < c_minutes
  901. || u_year == c_year && u_month == c_month && u_day == c_day && u_hours == c_hours && u_minutes == c_minutes && u_seconds <= c_seconds )
  902. {
  903. #if MAX_BANS <= 0
  904. Log("Ban time is up for: %s [%s]", data[bd_name], data[bd_steamid]);
  905.  
  906. Print("^x04[%s]^x03 %s^x01[^x04%s^x01]^x03 Lejárt a ban!^x01 [Indok: %s]", PREFIX, data[bd_name], data[bd_steamid], data[bd_reason]);
  907.  
  908. RemoveBan(i, data[bd_steamid]);
  909. #else
  910. Log("Ban time is up for: %s [%s]", g_names[i], g_steamids[i]);
  911.  
  912. Print("^x04[%s]^x03 %s^x01[^x04%s^x01]^x03 lejárt a ban idő!^x01 [Indok: %s]", PREFIX, g_names[i], g_steamids[i], g_reasons[i]);
  913.  
  914. RemoveBan(i);
  915. #endif
  916.  
  917. i--; // current pos was replaced with another ban, so we need to check it again.
  918. }
  919. }
  920. }
  921.  
  922. entity_set_float(g_unban_entity, EV_FL_nextthink, get_gametime() + get_pcvar_float(ab_unbancheck));
  923. }
  924.  
  925. public TaskDisconnectPlayer(client)
  926. {
  927. server_cmd("kick #%i ^"Bannolva lettel. Nezd meg a konzolod!^"", get_user_userid(client));
  928. }
  929.  
  930. AddBan(const target_name[], const target_steamid[], const reason[], const length, const unban_time[], const admin_name[], const admin_steamid[])
  931. {
  932. #if MAX_BANS > 0
  933. if( g_total_bans == MAX_BANS )
  934. {
  935. log_amx("Ban list is full! (%i)", g_total_bans);
  936. return;
  937. }
  938. #endif
  939.  
  940. #if defined USING_SQL
  941. static target_name2[32], reason2[128], admin_name2[32];
  942. MakeStringSQLSafe(target_name, target_name2, sizeof(target_name2) - 1);
  943. MakeStringSQLSafe(reason, reason2, sizeof(reason2) - 1);
  944. MakeStringSQLSafe(admin_name, admin_name2, sizeof(admin_name2) - 1);
  945.  
  946. static query[512];
  947. formatex(query, sizeof(query) - 1,\
  948. "INSERT INTO `%s` (`%s`, `%s`, `%s`, `%s`, `%s`, `%s`, `%s`) VALUES ('%s', '%s', '%i', '%s', '%s', '%s', '%s');",\
  949. TABLE_NAME, KEY_NAME, KEY_STEAMID, KEY_BANLENGTH, KEY_UNBANTIME, KEY_REASON, KEY_ADMIN_NAME, KEY_ADMIN_STEAMID,\
  950. target_name2, target_steamid, length, unban_time, reason2, admin_name2, admin_steamid
  951. );
  952.  
  953. SQL_ThreadQuery(g_sql_tuple, "QueryAddBan", query);
  954. #else
  955. new f = fopen(g_ban_file, "a+");
  956.  
  957. fprintf(f, "^"%s^" ^"%s^" %i ^"%s^" ^"%s^" ^"%s^" ^"%s^"^n",\
  958. target_steamid,\
  959. target_name,\
  960. length,\
  961. unban_time,\
  962. reason,\
  963. admin_name,\
  964. admin_steamid
  965. );
  966.  
  967. fclose(f);
  968. #endif
  969.  
  970. #if MAX_BANS <= 0
  971. static data[BannedData];
  972. copy(data[bd_name], sizeof(data[bd_name]) - 1, target_name);
  973. copy(data[bd_steamid], sizeof(data[bd_steamid]) - 1, target_steamid);
  974. data[bd_banlength] = length;
  975. copy(data[bd_unbantime], sizeof(data[bd_unbantime]) - 1, unban_time);
  976. copy(data[bd_reason], sizeof(data[bd_reason]) - 1, reason);
  977. copy(data[bd_admin_name], sizeof(data[bd_admin_name]) - 1, admin_name);
  978. copy(data[bd_admin_steamid], sizeof(data[bd_admin_steamid]) - 1, admin_steamid);
  979.  
  980. TrieSetCell(g_trie, target_steamid, g_total_bans);
  981. ArrayPushArray(g_array, data);
  982. #else
  983. copy(g_names[g_total_bans], sizeof(g_names[]) - 1, target_name);
  984. copy(g_steamids[g_total_bans], sizeof(g_steamids[]) - 1, target_steamid);
  985. g_banlengths[g_total_bans] = length;
  986. copy(g_unbantimes[g_total_bans], sizeof(g_unbantimes[]) - 1, unban_time);
  987. copy(g_reasons[g_total_bans], sizeof(g_reasons[]) - 1, reason);
  988. copy(g_admin_names[g_total_bans], sizeof(g_admin_names[]) - 1, admin_name);
  989. copy(g_admin_steamids[g_total_bans], sizeof(g_admin_steamids[]) - 1, admin_steamid);
  990. #endif
  991.  
  992. g_total_bans++;
  993.  
  994. #if MAX_BANS > 0
  995. if( g_total_bans == MAX_BANS )
  996. {
  997. log_amx("Ban list is full! (%i)", g_total_bans);
  998. }
  999. #endif
  1000. }
  1001.  
  1002. #if defined USING_SQL
  1003. public QueryAddBan(failstate, Handle:query, error[], errcode, data[], datasize, Float:queuetime)
  1004. {
  1005. if( failstate == TQUERY_CONNECT_FAILED )
  1006. {
  1007. set_fail_state("Could not connect to database.");
  1008. }
  1009. else if( failstate == TQUERY_QUERY_FAILED )
  1010. {
  1011. set_fail_state("Query failed.");
  1012. }
  1013. else if( errcode )
  1014. {
  1015. log_amx("Error on query: %s", error);
  1016. }
  1017. else
  1018. {
  1019. // Yay, ban was added! We can all rejoice!
  1020. }
  1021. }
  1022.  
  1023. public QueryDeleteBan(failstate, Handle:query, error[], errcode, data[], datasize, Float:queuetime)
  1024. {
  1025. if( failstate == TQUERY_CONNECT_FAILED )
  1026. {
  1027. set_fail_state("Could not connect to database.");
  1028. }
  1029. else if( failstate == TQUERY_QUERY_FAILED )
  1030. {
  1031. set_fail_state("Query failed.");
  1032. }
  1033. else if( errcode )
  1034. {
  1035. log_amx("Error on query: %s", error);
  1036. }
  1037. else
  1038. {
  1039. // Yay, ban was deleted! We can all rejoice!
  1040. }
  1041. }
  1042.  
  1043. public QueryLoadBans(failstate, Handle:query, error[], errcode, data[], datasize, Float:queuetime)
  1044. {
  1045. if( failstate == TQUERY_CONNECT_FAILED )
  1046. {
  1047. set_fail_state("Could not connect to database.");
  1048. }
  1049. else if( failstate == TQUERY_QUERY_FAILED )
  1050. {
  1051. set_fail_state("Query failed.");
  1052. }
  1053. else if( errcode )
  1054. {
  1055. log_amx("Error on query: %s", error);
  1056. }
  1057. else
  1058. {
  1059. if( SQL_NumResults(query) )
  1060. {
  1061. #if MAX_BANS <= 0
  1062. static data[BannedData];
  1063. while( SQL_MoreResults(query) )
  1064. #else
  1065. while( SQL_MoreResults(query) && g_total_bans < MAX_BANS )
  1066. #endif
  1067. {
  1068. #if MAX_BANS <= 0
  1069. SQL_ReadResult(query, 0, data[bd_name], sizeof(data[bd_name]) - 1);
  1070. SQL_ReadResult(query, 1, data[bd_steamid], sizeof(data[bd_steamid]) - 1);
  1071. data[bd_banlength] = SQL_ReadResult(query, 2);
  1072. SQL_ReadResult(query, 3, data[bd_unbantime], sizeof(data[bd_unbantime]) - 1);
  1073. SQL_ReadResult(query, 4, data[bd_reason], sizeof(data[bd_reason]) - 1);
  1074. SQL_ReadResult(query, 5, data[bd_admin_name], sizeof(data[bd_admin_name]) - 1);
  1075. SQL_ReadResult(query, 6, data[bd_admin_steamid], sizeof(data[bd_admin_steamid]) - 1);
  1076.  
  1077. ArrayPushArray(g_array, data);
  1078. TrieSetCell(g_trie, data[bd_steamid], g_total_bans);
  1079. #else
  1080. SQL_ReadResult(query, 0, g_names[g_total_bans], sizeof(g_names[]) - 1);
  1081. SQL_ReadResult(query, 1, g_steamids[g_total_bans], sizeof(g_steamids[]) - 1);
  1082. g_banlengths[g_total_bans] = SQL_ReadResult(query, 2);
  1083. SQL_ReadResult(query, 3, g_unbantimes[g_total_bans], sizeof(g_unbantimes[]) - 1);
  1084. SQL_ReadResult(query, 4, g_reasons[g_total_bans], sizeof(g_reasons[]) - 1);
  1085. SQL_ReadResult(query, 5, g_admin_names[g_total_bans], sizeof(g_admin_names[]) - 1);
  1086. SQL_ReadResult(query, 6, g_admin_steamids[g_total_bans], sizeof(g_admin_steamids[]) - 1);
  1087. #endif
  1088.  
  1089. g_total_bans++;
  1090.  
  1091. SQL_NextRow(query);
  1092. }
  1093. }
  1094.  
  1095. set_task(RELOAD_BANS_INTERVAL, "LoadBans");
  1096.  
  1097. g_loading_bans = false;
  1098. }
  1099. }
  1100. #endif
  1101.  
  1102. #if MAX_BANS > 0
  1103. RemoveBan(remove)
  1104. {
  1105. #if defined USING_SQL
  1106. static query[128];
  1107. formatex(query, sizeof(query) - 1,\
  1108. "DELETE FROM `%s` WHERE `%s` = '%s';",\
  1109. TABLE_NAME, KEY_STEAMID, g_steamids[remove]
  1110. );
  1111.  
  1112. SQL_ThreadQuery(g_sql_tuple, "QueryDeleteBan", query);
  1113. #endif
  1114.  
  1115. for( new i = remove; i < g_total_bans; i++ )
  1116. {
  1117. if( (i + 1) == g_total_bans )
  1118. {
  1119. copy(g_names[i], sizeof(g_names[]) - 1, "");
  1120. copy(g_steamids[i], sizeof(g_steamids[]) - 1, "");
  1121. g_banlengths[i] = 0;
  1122. copy(g_unbantimes[i], sizeof(g_unbantimes[]) - 1, "");
  1123. copy(g_reasons[i], sizeof(g_reasons[]) - 1, "");
  1124. copy(g_admin_names[i], sizeof(g_admin_names[]) - 1, "");
  1125. copy(g_admin_steamids[i], sizeof(g_admin_steamids[]) - 1, "");
  1126. }
  1127. else
  1128. {
  1129. copy(g_names[i], sizeof(g_names[]) - 1, g_names[i + 1]);
  1130. copy(g_steamids[i], sizeof(g_steamids[]) - 1, g_steamids[i + 1]);
  1131. g_banlengths[i] = g_banlengths[i + 1];
  1132. copy(g_unbantimes[i], sizeof(g_unbantimes[]) - 1, g_unbantimes[i + 1]);
  1133. copy(g_reasons[i], sizeof(g_reasons[]) - 1, g_reasons[i + 1]);
  1134. copy(g_admin_names[i], sizeof(g_admin_names[]) - 1, g_admin_names[i + 1]);
  1135. copy(g_admin_steamids[i], sizeof(g_admin_steamids[]) - 1, g_admin_steamids[i + 1]);
  1136. }
  1137. }
  1138.  
  1139. g_total_bans--;
  1140.  
  1141. #if !defined USING_SQL
  1142. new f = fopen(g_ban_file, "wt");
  1143.  
  1144. static name[32], steamid[35], banlength, unbantime[32], reason[128], admin_name[32], admin_steamid[35];
  1145. for( new i = 0; i < g_total_bans; i++ )
  1146. {
  1147. copy(name, sizeof(name) - 1, g_names[i]);
  1148. copy(steamid, sizeof(steamid) - 1, g_steamids[i]);
  1149. banlength = g_banlengths[i];
  1150. copy(unbantime, sizeof(unbantime) - 1, g_unbantimes[i]);
  1151. copy(reason, sizeof(reason) - 1, g_reasons[i]);
  1152. copy(admin_name, sizeof(admin_name) - 1, g_admin_names[i]);
  1153. copy(admin_steamid, sizeof(admin_steamid) - 1, g_admin_steamids[i]);
  1154.  
  1155. fprintf(f, "^"%s^" ^"%s^" %i ^"%s^" ^"%s^" ^"%s^" ^"%s^"^n",\
  1156. steamid,\
  1157. name,\
  1158. banlength,\
  1159. unbantime,\
  1160. reason,\
  1161. admin_name,\
  1162. admin_steamid
  1163. );
  1164. }
  1165.  
  1166. fclose(f);
  1167. #endif
  1168. }
  1169. #else
  1170. RemoveBan(pos, const authid[])
  1171. {
  1172. TrieDeleteKey(g_trie, authid);
  1173. ArrayDeleteItem(g_array, pos);
  1174.  
  1175. g_total_bans--;
  1176.  
  1177. #if defined USING_SQL
  1178. static query[128];
  1179. formatex(query, sizeof(query) - 1,\
  1180. "DELETE FROM `%s` WHERE `%s` = '%s';",\
  1181. TABLE_NAME, KEY_STEAMID, authid
  1182. );
  1183.  
  1184. SQL_ThreadQuery(g_sql_tuple, "QueryDeleteBan", query);
  1185.  
  1186. new data[BannedData];
  1187. for( new i = 0; i < g_total_bans; i++ )
  1188. {
  1189. ArrayGetArray(g_array, i, data);
  1190. TrieSetCell(g_trie, data[bd_steamid], i);
  1191. }
  1192. #else
  1193. new f = fopen(g_ban_file, "wt");
  1194.  
  1195. new data[BannedData];
  1196. for( new i = 0; i < g_total_bans; i++ )
  1197. {
  1198. ArrayGetArray(g_array, i, data);
  1199. TrieSetCell(g_trie, data[bd_steamid], i);
  1200.  
  1201. fprintf(f, "^"%s^" ^"%s^" %i ^"%s^" ^"%s^" ^"%s^" ^"%s^"^n",\
  1202. data[bd_steamid],\
  1203. data[bd_name],\
  1204. data[bd_banlength],\
  1205. data[bd_unbantime],\
  1206. data[bd_reason],\
  1207. data[bd_admin_name],\
  1208. data[bd_admin_steamid]
  1209. );
  1210. }
  1211.  
  1212. fclose(f);
  1213. #endif
  1214. }
  1215. #endif
  1216.  
  1217. #if defined KEEP_DEFAULT_BANS
  1218. LoadOldBans(filename[])
  1219. {
  1220. if( file_exists(filename) )
  1221. {
  1222. new f = fopen(filename, "rt");
  1223.  
  1224. static data[96];
  1225. static command[10], minutes[10], steamid[35], length, unban_time[32];
  1226.  
  1227. while( !feof(f) )
  1228. {
  1229. fgets(f, data, sizeof(data) - 1);
  1230. if( !data[0] ) continue;
  1231.  
  1232. parse(data, command, sizeof(command) - 1, minutes, sizeof(minutes) - 1, steamid, sizeof(steamid) - 1);
  1233. if( filename[0] == 'b' && !equali(command, "banid") || filename[0] == 'l' && !equali(command, "addip") ) continue;
  1234.  
  1235. length = str_to_num(minutes);
  1236. GenerateUnbanTime(length, unban_time, sizeof(unban_time) - 1);
  1237.  
  1238. AddBan("", steamid, "", length, unban_time, "", "");
  1239. }
  1240.  
  1241. fclose(f);
  1242.  
  1243. static filename2[32];
  1244.  
  1245. // copy current
  1246. copy(filename2, sizeof(filename2) - 1, filename);
  1247.  
  1248. // cut off at the "."
  1249. // banned.cfg = banned
  1250. // listip.cfg = listip
  1251. filename2[containi(filename2, ".")] = 0;
  1252.  
  1253. // add 2.cfg
  1254. // banned = banned2.cfg
  1255. // listip = listip2.cfg
  1256. add(filename2, sizeof(filename2) - 1, "2.cfg");
  1257.  
  1258. // rename file so that it isnt loaded again
  1259. while( !rename_file(filename, filename2, 1) ) { }
  1260. }
  1261. }
  1262. #endif
  1263.  
  1264. public LoadBans()
  1265. {
  1266. if( g_total_bans )
  1267. {
  1268. #if MAX_BANS <= 0
  1269. TrieClear(g_trie);
  1270. ArrayClear(g_array);
  1271. #endif
  1272.  
  1273. g_total_bans = 0;
  1274. }
  1275.  
  1276. #if defined USING_SQL
  1277. static query[128];
  1278. formatex(query, sizeof(query) - 1,\
  1279. "SELECT * FROM `%s`;",\
  1280. TABLE_NAME
  1281. );
  1282.  
  1283. SQL_ThreadQuery(g_sql_tuple, "QueryLoadBans", query);
  1284.  
  1285. g_loading_bans = true;
  1286. #else
  1287. if( file_exists(g_ban_file) )
  1288. {
  1289. new f = fopen(g_ban_file, "rt");
  1290.  
  1291. static filedata[512], length[10];
  1292.  
  1293. #if MAX_BANS <= 0
  1294. static data[BannedData];
  1295. while( !feof(f) )
  1296. #else
  1297. while( !feof(f) && g_total_bans < MAX_BANS )
  1298. #endif
  1299. {
  1300. fgets(f, filedata, sizeof(filedata) - 1);
  1301.  
  1302. if( !filedata[0] ) continue;
  1303.  
  1304. #if MAX_BANS <= 0
  1305. parse(filedata,\
  1306. data[bd_steamid], sizeof(data[bd_steamid]) - 1,\
  1307. data[bd_name], sizeof(data[bd_name]) - 1,\
  1308. length, sizeof(length) - 1,\
  1309. data[bd_unbantime], sizeof(data[bd_unbantime]) - 1,\
  1310. data[bd_reason], sizeof(data[bd_reason]) - 1,\
  1311. data[bd_admin_name], sizeof(data[bd_admin_name]) - 1,\
  1312. data[bd_admin_steamid], sizeof(data[bd_admin_steamid]) - 1
  1313. );
  1314.  
  1315. data[bd_banlength] = str_to_num(length);
  1316.  
  1317. ArrayPushArray(g_array, data);
  1318. TrieSetCell(g_trie, data[bd_steamid], g_total_bans);
  1319. #else
  1320. static steamid[35], name[32], unbantime[32], reason[128], admin_name[32], admin_steamid[35];
  1321.  
  1322. parse(filedata,\
  1323. steamid, sizeof(steamid) - 1,\
  1324. name, sizeof(name) - 1,\
  1325. length, sizeof(length) - 1,\
  1326. unbantime, sizeof(unbantime) - 1,\
  1327. reason, sizeof(reason) - 1,\
  1328. admin_name, sizeof(admin_name) - 1,\
  1329. admin_steamid, sizeof(admin_steamid) - 1
  1330. );
  1331.  
  1332. copy(g_names[g_total_bans], sizeof(g_names[]) - 1, name);
  1333. copy(g_steamids[g_total_bans], sizeof(g_steamids[]) - 1, steamid);
  1334. g_banlengths[g_total_bans] = str_to_num(length);
  1335. copy(g_unbantimes[g_total_bans], sizeof(g_unbantimes[]) - 1, unbantime);
  1336. copy(g_reasons[g_total_bans], sizeof(g_reasons[]) - 1, reason);
  1337. copy(g_admin_names[g_total_bans], sizeof(g_admin_names[]) - 1, admin_name);
  1338. copy(g_admin_steamids[g_total_bans], sizeof(g_admin_steamids[]) - 1, admin_steamid);
  1339. #endif
  1340.  
  1341. g_total_bans++;
  1342. }
  1343.  
  1344. fclose(f);
  1345. }
  1346. #endif
  1347.  
  1348. // load these after, so when they are added to the file with AddBan(), they aren't loaded again from above.
  1349.  
  1350. #if defined KEEP_DEFAULT_BANS
  1351. LoadOldBans("banned.cfg");
  1352. LoadOldBans("listip.cfg");
  1353. #endif
  1354. }
  1355.  
  1356. #if defined USING_SQL
  1357. MakeStringSQLSafe(const input[], output[], len)
  1358. {
  1359. copy(output, len, input);
  1360. replace_all(output, len, "'", "*");
  1361. replace_all(output, len, "^"", "*");
  1362. replace_all(output, len, "`", "*");
  1363. }
  1364. #endif
  1365.  
  1366. GetBanTime(const bantime, length[], len)
  1367. {
  1368. new minutes = bantime;
  1369. new hours = 0;
  1370. new days = 0;
  1371.  
  1372. while( minutes >= 60 )
  1373. {
  1374. minutes -= 60;
  1375. hours++;
  1376. }
  1377.  
  1378. while( hours >= 24 )
  1379. {
  1380. hours -= 24;
  1381. days++;
  1382. }
  1383.  
  1384. new bool:add_before;
  1385. if( minutes )
  1386. {
  1387. formatex(length, len, "%i perc%s", minutes, minutes == 1 ? "" : "");
  1388.  
  1389. add_before = true;
  1390. }
  1391. if( hours )
  1392. {
  1393. if( add_before )
  1394. {
  1395. format(length, len, "%i Ăłra%s, %s", hours, hours == 1 ? "" : "", length);
  1396. }
  1397. else
  1398. {
  1399. formatex(length, len, "%i Ăłra%s", hours, hours == 1 ? "" : "");
  1400.  
  1401. add_before = true;
  1402. }
  1403. }
  1404. if( days )
  1405. {
  1406. if( add_before )
  1407. {
  1408. format(length, len, "%i nap%s, %s", days, days == 1 ? "" : "", length);
  1409. }
  1410. else
  1411. {
  1412. formatex(length, len, "%i nap%s", days, days == 1 ? "" : "");
  1413.  
  1414. add_before = true;
  1415. }
  1416. }
  1417. if( !add_before )
  1418. {
  1419. // minutes, hours, and days = 0
  1420. // assume permanent ban
  1421. copy(length, len, "Orok ban");
  1422. }
  1423. }
  1424.  
  1425. GenerateUnbanTime(const bantime, unban_time[], len)
  1426. {
  1427. static _hours[5], _minutes[5], _seconds[5], _month[5], _day[5], _year[7];
  1428. format_time(_hours, sizeof(_hours) - 1, "%H");
  1429. format_time(_minutes, sizeof(_minutes) - 1, "%M");
  1430. format_time(_seconds, sizeof(_seconds) - 1, "%S");
  1431. format_time(_month, sizeof(_month) - 1, "%m");
  1432. format_time(_day, sizeof(_day) - 1, "%d");
  1433. format_time(_year, sizeof(_year) - 1, "%Y");
  1434.  
  1435. new hours = str_to_num(_hours);
  1436. new minutes = str_to_num(_minutes);
  1437. new seconds = str_to_num(_seconds);
  1438. new month = str_to_num(_month);
  1439. new day = str_to_num(_day);
  1440. new year = str_to_num(_year);
  1441.  
  1442. minutes += bantime;
  1443.  
  1444. while( minutes >= 60 )
  1445. {
  1446. minutes -= 60;
  1447. hours++;
  1448. }
  1449.  
  1450. while( hours >= 24 )
  1451. {
  1452. hours -= 24;
  1453. day++;
  1454. }
  1455.  
  1456. new max_days = GetDaysInMonth(month, year);
  1457. while( day > max_days )
  1458. {
  1459. day -= max_days;
  1460. month++;
  1461. }
  1462.  
  1463. while( month > 12 )
  1464. {
  1465. month -= 12;
  1466. year++;
  1467. }
  1468.  
  1469. formatex(unban_time, len, "%i:%02i:%02i %i/%i/%i", hours, minutes, seconds, month, day, year);
  1470. }
  1471.  
  1472. GetDaysInMonth(month, year=0)
  1473. {
  1474. switch( month )
  1475. {
  1476. case 1:         return 31; // january
  1477. case 2:         return ((year % 4) == 0) ? 29 : 28; // february
  1478. case 3:         return 31; // march
  1479. case 4:         return 30; // april
  1480. case 5:         return 31; // may
  1481. case 6:         return 30; // june
  1482. case 7:         return 31; // july
  1483. case 8:         return 31; // august
  1484. case 9:         return 30; // september
  1485. case 10:        return 31; // october
  1486. case 11:        return 30; // november
  1487. case 12:        return 31; // december
  1488. }
  1489.  
  1490. return 30;
  1491. }
  1492.  
  1493. GetTargetFlags(client)
  1494. {
  1495. static const flags_no_immunity = (CMDTARGET_ALLOW_SELF|CMDTARGET_NO_BOTS);
  1496. static const flags_immunity = (CMDTARGET_ALLOW_SELF|CMDTARGET_NO_BOTS|CMDTARGET_OBEY_IMMUNITY);
  1497.  
  1498. switch( get_pcvar_num(ab_immunity) )
  1499. {
  1500. case 1: return flags_immunity;
  1501. case 2: return access(client, ADMIN_IMMUNITY) ? flags_no_immunity : flags_immunity;
  1502. }
  1503.  
  1504. return flags_no_immunity;
  1505. }
  1506.  
  1507. GetMaxBanTime(client)
  1508. {
  1509. if( !g_total_maxban_times ) return 0;
  1510.  
  1511. new flags = get_user_flags(client);
  1512.  
  1513. for( new i = 0; i < g_total_maxban_times; i++ )
  1514. {
  1515. #if !defined MAX_BANLIMITS
  1516. if( flags & ArrayGetCell(g_maxban_flags, i) )
  1517. {
  1518.     return ArrayGetCell(g_maxban_times, i);
  1519. }
  1520. #else
  1521. if( flags & g_maxban_flags[i] )
  1522. {
  1523.     return g_maxban_times[i];
  1524. }
  1525. #endif
  1526. }
  1527.  
  1528. return 0;
  1529. }
  1530.  
  1531. PrintBanInformation(client, const target_name[], const target_authid[], const reason[], const length, const unban_time[], const admin_name[], const admin_authid[], bool:show_admin, bool:show_website)
  1532. {
  1533. static website[64], ban_length[64];
  1534. if( client == 0 )
  1535. {
  1536. server_print("************************************************");
  1537. server_print("%L", client, "AB_BAN_INFORMATION");
  1538. server_print("%L: %s", client, "AB_NAME", target_name);
  1539. server_print("%L: %s", client, IsValidAuthid(target_authid) ? "AB_STEAMID" : "AB_IP", target_authid);
  1540. server_print("%L: %s", client, "AB_REASON", reason);
  1541. if( length > 0 )
  1542. {
  1543. GetBanTime(length, ban_length, sizeof(ban_length) - 1);
  1544. server_print("%L: %s", client, "AB_BAN_LENGTH", ban_length);
  1545. }
  1546. server_print("%L: %s", client, "AB_UNBAN_TIME", unban_time);
  1547. if( show_admin )
  1548. {
  1549. server_print("%L: %s", client, "AB_ADMIN_NAME", admin_name);
  1550. server_print("%L: %s", client, "AB_ADMIN_STEAMID", admin_authid);
  1551. }
  1552. if( show_website )
  1553. {
  1554. get_pcvar_string(ab_website, website, sizeof(website) - 1);
  1555. if( website[0] )
  1556. {
  1557.     server_print("");
  1558.     server_print("%L", client, "AB_WEBSITE");
  1559.     server_print("%s", website);
  1560. }
  1561. }
  1562. server_print("************************************************");
  1563. }
  1564. else
  1565. {
  1566. client_cmd(client, "echo ^"************************************************^"");
  1567. client_cmd(client, "echo ^"%L^"", client, "AB_BAN_INFORMATION");
  1568. client_cmd(client, "echo ^"%L: %s^"", client, "AB_NAME", target_name);
  1569. client_cmd(client, "echo ^"%L: %s^"", client, IsValidAuthid(target_authid) ? "AB_STEAMID" : "AB_IP", target_authid);
  1570. client_cmd(client, "echo ^"%L: %s^"", client, "AB_REASON", reason);
  1571. if( length > 0 )
  1572. {
  1573. GetBanTime(length, ban_length, sizeof(ban_length) - 1);
  1574. client_cmd(client, "echo ^"%L: %s^"", client, "AB_BAN_LENGTH", ban_length);
  1575. }
  1576. client_cmd(client, "echo ^"%L: %s^"", client, "AB_UNBAN_TIME", unban_time);
  1577. if( show_admin )
  1578. {
  1579. client_cmd(client, "echo ^"%L: %s^"", client, "AB_ADMIN_NAME", admin_name);
  1580. client_cmd(client, "echo ^"%L: %s^"", client, "AB_ADMIN_STEAMID", admin_authid);
  1581. }
  1582. if( show_website )
  1583. {
  1584. get_pcvar_string(ab_website, website, sizeof(website) - 1);
  1585. if( website[0] )
  1586. {
  1587.     client_cmd(client, "echo ^"^"");
  1588.     client_cmd(client, "echo ^"%L^"", client, "AB_WEBSITE");
  1589.     client_cmd(client, "echo ^"%s^"", website);
  1590. }
  1591. }
  1592. client_cmd(client, "echo ^"************************************************^"");
  1593. }
  1594. }
  1595.  
  1596. PrintActivity(const admin_name[], const message_fmt[], any:...)
  1597. {
  1598. if( !get_playersnum() ) return;
  1599.  
  1600. new activity = get_pcvar_num(amx_show_activity);
  1601. if( !(0 <= activity <= 5) )
  1602. {
  1603. set_pcvar_num(amx_show_activity, (activity = 2));
  1604. }
  1605.  
  1606. static message[191], temp[191];
  1607. vformat(message, sizeof(message) - 1, message_fmt, 3);
  1608.  
  1609. for( new client = 1; client <= g_max_clients; client++ )
  1610. {
  1611. if( !is_user_connected(client) ) continue;
  1612.  
  1613. switch( is_user_admin(client) ? g_admin_activity[activity] : g_normal_activity[activity] )
  1614. {
  1615. case ACTIVITY_NONE:
  1616. {
  1617.  
  1618. }
  1619. case ACTIVITY_HIDE:
  1620. {
  1621. copy(temp, sizeof(temp) - 1, message);
  1622. replace(temp, sizeof(temp) - 1, "$name", "ADMIN");
  1623.  
  1624. message_begin(MSG_ONE_UNRELIABLE, g_msgid_SayText, _, client);
  1625. write_byte(client);
  1626. write_string(temp);
  1627. message_end();
  1628. }
  1629. case ACTIVITY_SHOW:
  1630. {
  1631. copy(temp, sizeof(temp) - 1, message);
  1632. replace(temp, sizeof(temp) - 1, "$name", admin_name);
  1633.  
  1634. message_begin(MSG_ONE_UNRELIABLE, g_msgid_SayText, _, client);
  1635. write_byte(client);
  1636. write_string(temp);
  1637. message_end();
  1638. }
  1639. }
  1640. }
  1641. }
  1642.  
  1643. Print(const message_fmt[], any:...)
  1644. {
  1645. if( !get_playersnum() ) return;
  1646.  
  1647. static message[191];
  1648. vformat(message, sizeof(message) - 1, message_fmt, 2);
  1649.  
  1650. for( new client = 1; client <= g_max_clients; client++ )
  1651. {
  1652. if( !is_user_connected(client) ) continue;
  1653.  
  1654. message_begin(MSG_ONE_UNRELIABLE, g_msgid_SayText, _, client);
  1655. write_byte(client);
  1656. write_string(message);
  1657. message_end();
  1658. }
  1659. }
  1660.  
  1661. Log(const message_fmt[], any:...)
  1662. {
  1663. static message[256];
  1664. vformat(message, sizeof(message) - 1, message_fmt, 2);
  1665.  
  1666. static filename[96];
  1667. #if defined HISTORY_ONE_FILE
  1668. if( !filename[0] )
  1669. {
  1670. get_basedir(filename, sizeof(filename) - 1);
  1671. add(filename, sizeof(filename) - 1, "/logs/ban_history.log");
  1672. }
  1673. #else
  1674. static dir[64];
  1675. if( !dir[0] )
  1676. {
  1677. get_basedir(dir, sizeof(dir) - 1);
  1678. add(dir, sizeof(dir) - 1, "/logs");
  1679. }
  1680.  
  1681. format_time(filename, sizeof(filename) - 1, "%m%d%Y");
  1682. format(filename, sizeof(filename) - 1, "%s/BAN_HISTORY_%s.log", dir, filename);
  1683. #endif
  1684.  
  1685. log_amx("%s", message);
  1686. log_to_file(filename, "%s", message);
  1687. }

_________________
BfS* #Team ~Global Offensive IP: 217.144.54.193:27148

Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Advancedban hiba (SQL)
HozzászólásElküldve: 2017.07.29. 16:56 
Offline
Nagyúr
Avatar

Csatlakozott: 2016.03.05. 20:56
Hozzászólások: 663
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 124 alkalommal
amxmodx/configs/sql.cfg-be is írd be az adatokat

_________________
Global Offensive modok:

Global Offensive Mode 1.0
Global Offensive Mode 3.0
exodus Global Offensive 4.0

Ők köszönték meg exodus nek ezt a hozzászólást (összesen 2): $weeT (2017.07.29. 17:02) • adriansr14 (2017.07.30. 10:06)
  Népszerűség: 4.55%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Advancedban hiba (SQL)
HozzászólásElküldve: 2017.07.30. 10:06 
Offline
Jómunkásember

Csatlakozott: 2016.06.20. 10:23
Hozzászólások: 489
Megköszönt másnak: 47 alkalommal
Megköszönték neki: 15 alkalommal
exodus írta:
amxmodx/configs/sql.cfg-be is írd be az adatokat


Jah.. tényleg... Köszi [profil]exodus[/profil]

_________________
BfS* #Team ~Global Offensive IP: 217.144.54.193:27148

Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Advancedban hiba (SQL)
HozzászólásElküldve: 2017.12.14. 09:15 
Offline
Tud valamit
Avatar

Csatlakozott: 2017.12.04. 09:15
Hozzászólások: 116
Megköszönt másnak: 58 alkalommal
Megköszönték neki: 2 alkalommal
adriansr14 írta:
exodus írta:
amxmodx/configs/sql.cfg-be is írd be az adatokat


Jah.. tényleg... Köszi [profil]exodus[/profil]

megmondanátok mit kell az sql.cfg írni? nagyon szépen megköszöném.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Advancedban hiba (SQL)
HozzászólásElküldve: 2017.12.14. 14:52 
Offline
Őstag
Avatar

Csatlakozott: 2015.07.27. 22:56
Hozzászólások: 1367
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 351 alkalommal
duvilax írta:
adriansr14 írta:
megmondanátok mit kell az sql.cfg írni? nagyon szépen megköszöném.


Ha megnyitottad volna már tudnád mi kell bele.
Végtére is csak SQL konfig fájl, én beleírnám a málnáspite receptjét.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Advancedban hiba (SQL)
HozzászólásElküldve: 2017.12.15. 08:50 
Offline
Tud valamit
Avatar

Csatlakozott: 2017.12.04. 09:15
Hozzászólások: 116
Megköszönt másnak: 58 alkalommal
Megköszönték neki: 2 alkalommal
regener írta:
duvilax írta:
adriansr14 írta:
megmondanátok mit kell az sql.cfg írni? nagyon szépen megköszöném.


Ha megnyitottad volna már tudnád mi kell bele.
Végtére is csak SQL konfig fájl, én beleírnám a málnáspite receptjét.

Megoldottam köszi azért.


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 36 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole