Fake Server Queries 1.0

Сообщения
11
Реакции
3
Ошибка
Ничего не происходит
ОС
Linux
Amx Mod X
1.9.0
Билд
ReHLDS version: 3.11.0.767-dev-mpatch
ReGamedll
ReGameDLL version: 5.21.0.546-dev
Версия Metamod
Metamod v1.21p37
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] Reunion RUN - reunion_mm_i386. v0.1.75 ini Start Never
[ 2] WHBlocker RUN - whblocker_mm_i38 v1.5.697 ini Chlvl ANY
[ 3] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0.5 ini Start ANY
[ 4] ReSRDetector RUN - resrdetector_mm_ v0.1.0 ini Chlvl ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9+M ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i38 v2.5 ini Chlvl ANY
[ 7] Revoice RUN - revoice_mm_i386. v0.1.0.3 ini Start Never
[ 8] FakeServerQueri RUN - fsq_amxx_i386.so v1.0 pl3 ANY ANY
[ 9] Engine RUN - engine_amxx_i386 v1.9.0.5 pl3 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl3 ANY ANY
[11] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl3 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl3 ANY ANY
[13] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl3 ANY ANY
[14] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl3 ANY ANY
[15] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl3 ANY ANY
[16] hackdetector RUN - hackdetector_amx v0.15.32 pl3 ANY ANY
[17] ReAPI RUN - reapi_amxx_i386. v5.21.0. pl3 ANY Never
[18] ReAimDetector RUN - reaimdetector_am v0.2.2 pl3 ANY Never
18 plugins, 18 running
Список плагинов
amxx plugins 
Currently loaded plugins:
name version author file status
[ 1] FakeServerQueries Mana 1.0 Inline fsq_manager.amx running
[ 2] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 3] [190] VIP RBS 20.07.20 SKAJIbnEJIb vip_rbs.amxx running
[ 4] [190] Chat Controller 20.06.06 SKAJIbnEJIb chat_controller running
[ 5] [190] MapChooser RBS 20.08.02 SKAJIbnEJIb & UF mapchooser_rbs. running
[ 6] [190] Damager RBS 20.06.06 SKAJIbnEJIb damager_rbs.amx running
[ 7] Admin Base 1.9.0.5262 AMXX Dev Team admin.amxx running
[ 8] [ReAMX] Ultimate Gag 17.12.22BE SKAJIbnEJIb ultimate_gag.am running
[ 9] VIP Меню 1.0beta Doc vipmenu.amxx running
[ 10] Killa HP 1.0 jas0n killa_hp.amxx running
[ 11] Reset Score 0.2 Silenttt / CepeH RESET_SCORE.amx running
[ 12] Killer screen fade 1.0 Flazh killerscreenfad running
[ 13] Auto Demo Recorder 2.2.1 F@nt0M demo_recorder.a running
[ 14] SpecList 1.2a FatalisDK speclist_rus.am running
[ 15] High Ping Kicker 1.0 Shadow/Bo0m! amx_hpk.amxx running
[ 16] HackDetector 0.15.lite Lev @ AGHL.RU De hackdetector.am running
[ 17] AWP Limit 0.14 mx?! awp_limit_new_0 running
[ 18] Admin Commands 1.9.0.5262 AMXX Dev Team admincmd.amxx running
[ 19] Slots Reservation 1.9.0.5262 AMXX Dev Team adminslots.amxx running
[ 20] End Round Sound and Pl 2.1 Eriurias EndRoundSound.a running
[ 21] Menus Front-End 1.9.0.5262 AMXX Dev Team menufront.amxx running
[ 22] Commands Menu 1.9.0.5262 AMXX Dev Team cmdmenu.amxx running
[ 23] Players Menu 1.9.0.5262 AMXX Dev Team plmenu.amxx running
[ 24] Plugin Menu 1.9.0.5262 AMXX Dev Team pluginmenu.amxx running
[ 25] Admin Votes 1.9.0.5262 AMXX Dev Team adminvote.amxx running
[ 26] [190] NextMap 18.09.25 SKAJIbnEJIb & AM nextmap.amxx running
[ 27] [190] TimeLeft 18.09.25 SKAJIbnEJIb & AM timeleft.amxx running
[ 28] Pause Plugins 1.9.0.5262 AMXX Dev Team pausecfg.amxx running
[ 29] Restrict Weapons 1.9.0.5262 AMXX Dev Team restmenu.amxx running
[ 30] CS Misc. Stats 1.9.0.5262 AMXX Dev Team miscstats.amxx running
[ 31] CS Stats Logging 1.9.0.5262 AMXX Dev Team stats_logging.a running
[ 32] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 33] [ReAPI] No Team Flash 1.0 ReHLDS Team noteamflash.amx running
[ 34] unknown unknown unknown uaio_admin_R3_M bad load
( 34) Load fails: Plugin file open error (plugin "uaio_admin_R3_MastaMan_Edition.amxx")
34 plugins, 33 running
Автор плагина
https://dev-cs.ru/members/371/
Версия плагина
1.0
Исходный код
/*
*
* Copyright (c) 2018 Alik Aslanyan <[email protected]>
*
*
* This file is part of Fake Server Queries
*
* Fake Server Queries is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* Fake Server Queries is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Fake Server Queries; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of Fake Server Queries with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/

#include <amxmodx>
#include <amxmisc>
#include <FakeServerQueries>
#include <cellarray>

#define PLUGIN "FakeServerQueries Manager"
#define VERSION "1.0"
#define AUTHOR "Inline"

#define RATIO 0.2
#define THINK_DELAY 5.0
#define RESERVE_SLOTS 1

#define SCORE_INCREMENT_CHANCE 0.5
#define SCORE_INCREMENT_DELAY 0.1

#define THINK_TASK 1
#define SCORE_INCREMENTER_TASK 2

new Array:g_FakesArray;
new Array:g_FakesNames;
new Array:g_FakesNamesIndices;

new g_MaxPlayers;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);

g_FakesArray = ArrayCreate(1, 1);
g_FakesNames = LoadNames();
g_FakesNamesIndices = CreateShuffledNamesIndices(g_FakesNames);

g_MaxPlayers = get_maxplayers();

DeferThink();
ScoreIncrementerTask();
}

public plugin_end() {
ArrayDestroy(g_FakesArray);
ArrayDestroy(g_FakesNames);
ArrayDestroy(g_FakesNamesIndices);
}

Array:LoadNames() {
new path[256];
new configsDirLen = get_configsdir(path, charsmax(path));
formatex(path[configsDirLen], charsmax(path) - configsDirLen, "/fsq_names.ini");
if(!file_exists(path)) {
log_to_error("File for bot names doesn't exist at path %s", path);
return Invalid_Array;
}

new file = fopen(path, "r");
if(!file) {
log_to_error("Can't open name file at path %s", path);
return Invalid_Array;
}

new Array:fakesNames = ArrayCreate(32, 1);

new buffer[1024];
new len = 0;
while((len = fgets(file, buffer, charsmax(buffer))) != 0) {
new commentPos = contain(buffer, "//");
new alternativeCommentPos = contain(buffer, ";");
if(alternativeCommentPos != -1) {
if(commentPos == -1) { // No // comment found, set ; comment pos
commentPos = alternativeCommentPos;
} else { // Select the first one by position.
commentPos = min(commentPos, alternativeCommentPos);
}
}

if(commentPos != -1) {
len -= commentPos;
format(buffer, len, "%s", buffer[commentPos]); // Remove comment
}
trim(buffer);
if(buffer[0] == '^0') {
continue;
}

ArrayPushString(fakesNames, buffer);
}

if(ArraySize(fakesNames) == 0) {
ArrayDestroy(fakesNames);
return Invalid_Array;
}

return fakesNames;
}

Array:CreateShuffledNamesIndices(Array:names) {
new size = ArraySize(names);
new Array:indices = ArrayCreate(1, size);
for(new i = 0; i < size;++i) {
ArrayPushCell(indices, i);
}
for(new i = 0; i < size;++i) {
ArraySwap(indices, i, random_num(0, size - 1));
}

return indices;
}

public GetNextName(outputName[32]) {
static index = 0;
if(index >= ArraySize(g_FakesNamesIndices)) {
index = 0;
}

new realIndex = ArrayGetCell(g_FakesNamesIndices, index++);

return ArrayGetString(g_FakesNames, realIndex, outputName, charsmax(outputName));
}

public client_connect(id) {
TryToThinkNow();
}

public client_disconnected(id) {
DeferThink();
}

TryToThinkNow() {
new playersAndFakesNum = get_playersnum(true) + ArraySize(g_FakesArray) ;
if(playersAndFakesNum >= g_MaxPlayers - RESERVE_SLOTS) {
Think();
} else {
DeferThink();
}
}

DeferThink() {
if(task_exists(THINK_TASK)) remove_task(THINK_TASK);
set_task(THINK_DELAY, "Think", THINK_TASK);
}

AddFakes(num) {
new name[32];
for(new i = 0; i < num; ++i) {
GetNextName(name);
new fakeId = fsq_create_fake(name);
if(fakeId == FSQ_ERROR) {
continue;
}
ArrayPushCell(g_FakesArray, fakeId);

}
}

RemoveFakes(num) {
for(new i = 0; i < num; ++i) {
new fakesArraySize = ArraySize(g_FakesArray);
if(fakesArraySize == 0) {
break;
}
new item = random_num(0, fakesArraySize - 1);
new id = ArrayGetCell(g_FakesArray, item);
fsq_destroy_fake(id);
ArrayDeleteItem(g_FakesArray, item);
}
}

stock log_to_error(const message[], any:...)
{
new log[256], date[32];
vformat(log, 255, message, 2);
get_time("error_%Y%m%d.log", date, 31);
log_to_file(date, "[%s] %s", PLUGIN, log);
}

public ScoreIncrementerTask()
{
new currentNumOfFakes = ArraySize(g_FakesArray);
if(currentNumOfFakes > 0 && random_num(0, 100) <= SCORE_INCREMENT_CHANCE) { // Increment score
new item = random_num(0, currentNumOfFakes - 1);
new fakeId = ArrayGetCell(g_FakesArray, item);
if(fakeId != FSQ_ERROR) {
fsq_set_fake_score(fakeId, fsq_get_fake_score(fakeId) + 1);
}
}
set_task_ex(SCORE_INCREMENT_DELAY + random_float(0.0, 0.5), "ScoreIncrementerTask", SCORE_INCREMENTER_TASK);
}

public Think() {

new playersNum = get_playersnum(true);
new fakesNum = floatround(float(playersNum) * RATIO);

// Clamp to max players
{
new diff = (fakesNum + playersNum) - (g_MaxPlayers - RESERVE_SLOTS) ;
if(diff >= 0) {
fakesNum = max(fakesNum - diff, 0);
}
}

new currentNumOfFakes = ArraySize(g_FakesArray);
if(currentNumOfFakes > fakesNum) { // Add fakes
RemoveFakes(currentNumOfFakes - fakesNum);
} else if(fakesNum > currentNumOfFakes) { // Remove fakes
AddFakes(fakesNum - currentNumOfFakes);
}
}
Добрый вечер! Плагин не работает, прошу оказать содействие, либо указать мою ошибку :derisive:
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу