- Ошибка
-
L 01/09/2018 - 16:45:51: [AMXX] Displaying debug trace (plugin "lrs_csstats.amxx", version "1.5 [HLDS]")
L 01/09/2018 - 16:45:51: [AMXX] Run time error 10: native error (native "ClearSyncHud")
L 01/09/2018 - 16:45:51: [AMXX] [0] lrs_csstats.sma::lrs_informer (line 259)
- ОС
- Linux
- Билд
-
version
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.3.0.628-dev
Build date: 13:49:36 Dec 20 2017 (1348)
Build from: https://github.com/dreamstalker/rehlds/commit/780afd0
- ReGamedll
-
game version
ReGameDLL version: 5.3.0.279-dev
Build date: 12:34:05 Dec 17 2017
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/565e9cd
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] VoiceTranscoder RUN - VoiceTranscoder. v2017RC3 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386. v0.1.75 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i v0.1.6 ini Start Never
[ 4] AMX Mod X RUN - amxmodx_mm_i386. v1.8.3-R ini Start ANY
[ 5] ProcessCmds RUN - processcmds_mm_i v1.1.3 ini Start Never
[ 6] Rechecker RUN - rechecker_mm_i38 v2.5 ini Chlvl ANY
[ 7] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 8] WHBlocker RUN - whblocker_mm_i38 v1.5.695 ini Chlvl ANY
[ 9] ReAimDetector RUN - reaimdetector_am v0.2.0 pl4 ANY Never
[10] ReAPI RUN - reapi_amxx_i386. v5.2.0.1 pl4 ANY Never
[11] CStrike RUN - cstrike_amxx_i38 v1.8.3-R pl4 ANY ANY
[12] CSX RUN - csx_amxx_i386.so v1.8.3-R pl4 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-R pl4 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-R pl4 ANY ANY
[15] MySQL RUN - mysql_amxx_i386. v1.8.3-R pl4 ANY ANY
[16] Engine RUN - engine_amxx_i386 v1.8.3-R pl4 ANY ANY
[17] Fun RUN - fun_amxx_i386.so v1.8.3-R pl4 ANY ANY
17 plugins, 17 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] ReAimDetector API 0.2.0 ReHLDS Team reaimdetector.a running
[ 2] Admin Loader 2.9 neygomon admin_loader.am running
[ 3] FreshBans 1.3.8b kanagava fresh_bans.amxx running
[ 4] fb_forwards 0.1.5 Kanagava & Realu fb_forwards.amx running
[ 5] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 6] Admin Commands 1.8.3-Re AMXX Dev Team admincmd.amxx running
[ 7] Menus Front-End 1.5 neugomon menufront.amxx running
[ 8] Commands Menu 1.8.3-Re AMXX Dev Team cmdmenu.amxx running
[ 9] Plugin Menu 1.8.3-Re AMXX Dev Team pluginmenu.amxx running
[ 10] Admin Chat 1.8.3-Re AMXX Dev Team adminchat.amxx running
[ 11] Player Votes 1.0 neugomon player_votes.am running
[ 12] Lite NightMode 1.1 neygomon lite_nightmode. running
[ 13] Advanced MapChooser 1.3 neygomon map_chooser.amx running
[ 14] Maps Menu 1.4.2 neugomon mapsmenu.amxx running
[ 15] Players Menu 1.7 neugomon plmenu.amxx running
[ 16] AES: StatsX 0.5 Vega serfreeman1337 statsx_aes.amxx running
[ 17] Say me and Say hp 1.4 neygomon sayme.amxx running
[ 18] Stats Configuration 1.8.3-Re AMXX Dev Team statscfg.amxx running
[ 19] Restrict Weapons 1.8.3-Re AMXX Dev Team restmenu.amxx running
[ 20] [ReAPI] AdminFreeLook 1.0 ReHLDS Team adminfreelook.a running
[ 21] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 22] GameName Changer 1.0 neugomon gamename_change running
[ 23] Mode 2x2 2.5re s1lent mode.amxx running
[ 24] [ReAPI] Lite TeamBalan 2.3 neugomon lite_balancer.a running
[ 25] [ReAPI] No Team Flash 1.0 ReHLDS Team noteamflash.amx running
[ 26] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 27] Admin ESP 0.3 miRror | Radius admin_esp_mini. running
[ 28] Advert Messages 1.2.2 neygomon adverts.amxx running
[ 29] Bomb Countdown HUD Tim 0.2 SAMURAI bcd_hudtimer.am running
[ 30] Lite Recoder 1.0.1 neygomon amx_demorec.amx running
[ 31] Block All Adverts 1.3 neygomon block_all_adver running
[ 32] Block grande info 1.0 neygomon BlockGrenadeInf running
[ 33] Lite Rank System 1.5 [HLDS] AcE lrs_csstats.amx debug
[ 34] [ReAPI] VIPka 1.4.0 neygomon re_vipka.amxx running
[ 35] Kills Counter 1.0 Safety1st killscounter.am running
[ 36] unknown unknown unknown radio_block.amx running
[ 37] Snow 1.1 pUzzlik snow.amxx running
[ 38] Ping Control 1.31 neygomon Ping_Control.am running
[ 39] Warming 1.0 I Am LeGenD warmup.amxx running
[ 40] Lite Translit 2.9 neygomon lite_translit.a running
40 plugins, 40 running
- Исходный код
-
#define AUTHOR "AcE"
#define VERSION "1.5 [HLDS]"
#define PLUGIN "Lite Rank System"
#define LASTUPDATE "25, November (11), 2017"
#include <amxmodx>
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#define argbreak strbreak
#define client_disconnected client_disconnect
#endif
// Модуль информера.
#define USE_MODULE 0
// 0 - Через fakemeta
// 1 - Через engine
#if USE_MODULE == 0
#include <fakemeta>
#endif
#if USE_MODULE == 1
#include <engine>
#endif
//#define CS_MYSQL
//#define CS_MYSQL_HUD_SKILL
//#define CSSTATSX_SQL
//#define CSSTATSX_SQL_HUD_SKILL
#define STATUS_VALUE
#define HUD_POSITION
#if defined STATUS_VALUE
enum _:MAX_TYPES {TYPE_NONE, TYPE_RELATION, TYPE_PLAYER}
enum {LOOK_FRIEND = 1, LOOK_ENEMY, LOOK_HOSTAGE}
enum _:MAX_REPLACES {RE_HP, RE_RANK, RE_NAME}
new const Replaces[MAX_REPLACES][] = {"%hp%", "%rank%", "%name%"}
new status_value[MAX_TYPES], gStatusText
#endif
#if defined CS_MYSQL
native csstats_get_statsnum()
native csstats_get_user_stats(id, stats[22])
#if defined CS_MYSQL_HUD_SKILL
#define FRAGS 0
#define DEATHS 1
native statsx_get_skill(stats[22], string[] = "", len = 0)
#endif
#endif
#if defined CSSTATSX_SQL
native get_statsnum_sql()
native get_user_stats_sql(index, stats[8], bodyhits[8])
#if defined CSSTATSX_SQL_HUD_SKILL
native get_user_skill(player, &Float:skill)
new const g_skill_letters[][] = {"L-", "L", "L+", "M-", "M", "M+", "H-", "H", "H+", "P-", "P", "P+", "G"}
new Float:g_skill_opt[sizeof g_skill_letters]
#endif
#endif
#if !defined CS_MYSQL && !defined CSSTATSX_SQL
#include <csx>
#endif
enum _:udata
{
level, exp, informer
}
new UserData[33][udata]
new Float:HudUpdateInterval
new g_Cvar[9], LEVELS[22], g_Connected
#define IsUserValid(%1) (1 <= %1 <= 32)
#define get_bit(%1,%2) (%1 & (1 << (%2 & 31)))
#define set_bit(%1,%2) (%1 |= (1 << (%2 & 31)))
#define reset_bit(%1,%2) (%1 &= ~(1 << (%2 & 31)))
new const CLASSES[][] =
{
"", "Курсант", "Рядовой", "Ефрейтор",
"Мл. Сержант", "Сержант", "Ст. Сержант",
"Старшина", "Прапорщик", "Ст. Прапорщик",
"Мл. Лейтенант", "Лейтенант", "Ст. Лейтенант",
"Капитан", "Майор", "Подполковник",
"Полковник", "Генерал-майор", "Генерал-лейтенант",
"Генерал-полковник", "Генерал армии", "Маршал РФ"
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("lrs_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED)
#if defined STATUS_VALUE
gStatusText = get_user_msgid("StatusText")
register_event("StatusValue", "StatusValueShow", "be")
#endif
register_event("DeathMsg", "EventDeath", "a", "1>0")
register_clcmd("say /lrshud", "informer_switch", 0, "switch experience informer on/off")
g_Cvar[1] = register_cvar("lrs_add_exp", "2")
g_Cvar[2] = register_cvar("lrs_add_exp_hs", "3")
g_Cvar[3] = register_cvar("lrs_levels", "0 20 40 60 100 150 200 300 400 600 1000 1500 2100 2700 3400 4200 5100 5900 7000 10000 15000")
g_Cvar[4] = register_cvar("lrs_hud_exp_type", "1")
g_Cvar[5] = register_cvar("lrs_hud_xypos", "0.01 0.22")
g_Cvar[6] = register_cvar("lrs_hud_color", "150 150 150")
g_Cvar[7] = register_cvar("lrs_hud_random_color", "0")
g_Cvar[8] = register_cvar("lrs_hud_update", "1.0")
HudUpdateInterval = get_pcvar_float(g_Cvar[8])
set_task(HudUpdateInterval, "lrs_informer", _, _, _, "b")
server_print(""); server_print(" %s Copyright (c) 2017 %s", PLUGIN, AUTHOR)
server_print(" Version %s build on %s", VERSION, LASTUPDATE); server_print("")
}
public plugin_cfg()
{
new LVL[22][16], cvLevels[256]
get_pcvar_string(g_Cvar[3], cvLevels, 255); trim(cvLevels)
parse(cvLevels, LVL[0], 15, LVL[1], 15, LVL[2], 15, LVL[3], 15, LVL[4], 15, LVL[5], 15, LVL[6], 15, LVL[7], 15, LVL[8], 15, LVL[9], 15, LVL[10], 15, LVL[11], 15, LVL[12], 15, LVL[13], 15, LVL[14], 15, LVL[15], 15, LVL[16], 15, LVL[17], 15, LVL[18], 15, LVL[19], 15, LVL[20], 15, LVL[21], 15)
for (new i = 0; i < 21; i ++)
LEVELS[i +1] = str_to_num(LVL[i])
#if defined CSSTATSX_SQL
#if defined CSSTATSX_SQL_HUD_SKILL
new levelString[512], stPos, ePos, rawPoint[20], cnt
new g_pCvarSkill = get_cvar_pointer("aes_statsx_skill")
get_pcvar_string(g_pCvarSkill, levelString, charsmax(levelString))
do {
ePos = strfind(levelString[stPos], " ")
formatex(rawPoint, ePos, levelString[stPos])
g_skill_opt[cnt] = str_to_float(rawPoint)
stPos += ePos + 1; cnt ++
if (cnt > sizeof g_skill_letters - 1)
break
} while(ePos != -1)
#endif
#endif
}
public client_putinserver(id)
{
set_bit(g_Connected, id)
arrayset(UserData[id], 0, udata)
set_task(0.9, "load_client_data", id + 777)
}
public client_disconnected(id)
return reset_bit(g_Connected, id)
public load_client_data(index)
{
new id = index - 777
if (!get_bit(g_Connected, id) && is_user_hltv(id)) return
#if defined CS_MYSQL
new st[22]
csstats_get_user_stats(id, st)
#endif
#if defined CSSTATSX_SQL
new st[8], bh[8]
get_user_stats_sql(id, st, bh)
#endif
#if !defined CS_MYSQL && !defined CSSTATSX_SQL
new st[8], bh[8]
get_user_stats(id, st, bh)
#endif
if (UserData[id][level] <= 1)
UserData[id][level] = 1
if (UserData[id][exp] < 0)
UserData[id][exp] = 0
if (get_pcvar_num(g_Cvar[2]) > 1)
{
new not_hs_num = st[0] - st[2]
new hs_points = st[2] * get_pcvar_num(g_Cvar[2])
new not_hs_points = not_hs_num * get_pcvar_num(g_Cvar[1])
UserData[id][exp] = hs_points + not_hs_points
}
else
{
UserData[id][exp] = st[0] * get_pcvar_num(g_Cvar[1])
}
for (new i = 1; i <= 21; i ++)
{
if (i < 21)
{
if (UserData[id][exp] >= LEVELS[i] && UserData[id][exp] < LEVELS[i +1])
UserData[id][level] = i
else if (UserData[id][exp] >= LEVELS[21])
UserData[id][level] = 21
}
}
}
public EventDeath()
{
static killer, victim
killer = read_data(1)
victim = read_data(2)
if (!get_bit(g_Connected, killer)) return
if (!IsUserValid(killer) || !IsUserValid(victim) || killer == victim) return
static szName[32]
get_user_name(killer, szName, 31)
if (UserData[killer][level] < 21)
{
static TempEXP
TempEXP = (read_data(3) == 1) ? get_pcvar_num(g_Cvar[2]) : get_pcvar_num(g_Cvar[1])
UserData[killer][exp] += TempEXP
if (UserData[killer][exp] >= LEVELS[UserData[killer][level] +1])
{
UserData[killer][level] ++
client_cmd(0, "spk events/task_complete")
client_print_color(0, print_team_default, "^1[^4LRS^1] Боец ^3%s ^1получил новое звание - ^4%s^1. Поздравляем!", szName, CLASSES[UserData[killer][level]])
}
}
}
public lrs_informer()
{
static live, id, target
static buffer[192], len, SyncHudMsg
if (!SyncHudMsg) SyncHudMsg = CreateHudSyncObj()
for (id = 1; id <= 32; id ++)
{
live = is_user_alive(id)
if (!get_bit(g_Connected, id) && is_user_ignore(id)) continue
if (UserData[id][informer]) continue
ClearSyncHud(id, SyncHudMsg)
#if USE_MODULE == 0
target = pev(id, pev_iuser2)
#endif
#if USE_MODULE == 1
target = entity_get_int(id, EV_INT_iuser2)
#endif
#if defined HUD_POSITION
static g_rank[33], g_maxrank
#if defined CS_MYSQL
static st[22]
g_maxrank = csstats_get_statsnum()
g_rank[id] = csstats_get_user_stats(id, st)
g_rank[target] = csstats_get_user_stats(target, st)
#endif
#if defined CSSTATSX_SQL
static st[8], bh[8]
g_maxrank = get_statsnum_sql()
g_rank[id] = get_user_stats_sql(id, st, bh)
g_rank[target] = get_user_stats_sql(target, st, bh)
#endif
#if !defined CS_MYSQL && !defined CSSTATSX_SQL
static st[8], bh[8]
g_maxrank = get_statsnum()
g_rank[id] = get_user_stats(id, st, bh)
g_rank[target] = get_user_stats(target, st, bh)
#endif
#endif
if (live)
{
len = format(buffer, charsmax(buffer), "Звание: %s", CLASSES[UserData[id][level]])
if (UserData[id][level] < 21)
{
if (get_pcvar_num(g_Cvar[4]) == 0)
len += format(buffer[len], charsmax(buffer) - len, "^nОпыт: [%d/%d]", UserData[id][exp], LEVELS[UserData[id][level] +1])
else len += format(buffer[len], charsmax(buffer) - len, "^nОпыт: [%d/%d][+%d]", UserData[id][exp], LEVELS[UserData[id][level] +1], (LEVELS[UserData[id][level] +1] - UserData[id][exp]))
}
else
{
len += format(buffer[len], charsmax(buffer) - len, "^nОпыт: Максимальный")
}
#if defined CS_MYSQL
#if defined CS_MYSQL_HUD_SKILL
new iRank = csstats_get_user_stats(id, st)
if (iRank > 0)
{
if (st[FRAGS] && st[DEATHS])
{
new szSkill[3], iSkill = statsx_get_skill(st, szSkill, charsmax(szSkill))
len += format(buffer[len], charsmax(buffer) - len, "^nСкилл: [%s|%d]", szSkill, iSkill)
}
}
#endif
#endif
#if defined CSSTATSX_SQL
#if defined CSSTATSX_SQL_HUD_SKILL
new Float:szSkill, szSkill_id
get_user_skill(id, szSkill)
szSkill_id = aes_statsx_get_skill_id(szSkill)
len += format(buffer[len], charsmax(buffer) - len, "^nСкилл: [%s|%.0f]", g_skill_letters[szSkill_id], szSkill)
#endif
#endif
#if defined HUD_POSITION
len += format(buffer[len], charsmax(buffer) - len, "^nПозиция: [%d из %d]", g_rank[id], g_maxrank)
#endif
len += format(buffer[len], charsmax(buffer) - len, "^nМы в VK: vk.com/platinum.group")
}
else
{
if (target > 0 && !live)
{
static szName[32]; get_user_name(target, szName, 31)
len = format(buffer, charsmax(buffer), "Ник: %s", szName)
len += format(buffer[len], charsmax(buffer) - len, "^nЗвание: %s", CLASSES[UserData[target][level]])
if (UserData[target][level] < 21)
{
if (get_pcvar_num(g_Cvar[4]) == 0)
len += format(buffer[len], charsmax(buffer) - len, "^nОпыт: [%d/%d]", UserData[target][exp], LEVELS[UserData[target][level] +1])
else len += format(buffer[len], charsmax(buffer) - len, "^nОпыт: [%d/%d][+%d]", UserData[target][exp], LEVELS[UserData[target][level] +1], (LEVELS[UserData[target][level] +1] - UserData[target][exp]))
}
else
{
len += format(buffer[len], charsmax(buffer) - len, "^nОпыт: Максимальный")
}
#if defined CS_MYSQL
#if defined CS_MYSQL_HUD_SKILL
new iRank = csstats_get_user_stats(target, st)
if (iRank > 0)
{
if (st[FRAGS] && st[DEATHS])
{
new szSkill[3], iSkill = statsx_get_skill(st, szSkill, charsmax(szSkill))
len += format(buffer[len], charsmax(buffer) - len, "^nСкилл: [%s|%d]", szSkill, iSkill)
}
}
#endif
#endif
#if defined CSSTATSX_SQL
#if defined CSSTATSX_SQL_HUD_SKILL
new Float:szSkill, szSkill_id
get_user_skill(target, szSkill)
szSkill_id = aes_statsx_get_skill_id(szSkill)
len += format(buffer[len], charsmax(buffer) - len, "^nСкилл: [%s|%.0f]", g_skill_letters[szSkill_id], szSkill)
#endif
#endif
#if defined HUD_POSITION
len += format(buffer[len], charsmax(buffer) - len, "^nПозиция: [%d из %d]", g_rank[target], g_maxrank)
#endif
len += format(buffer[len], charsmax(buffer) - len, "^nМы в VK: vk.com/platinum.group")
}
}
static r, g, b, Float:x, Float:y
HudMsgPos(x, y); HudMsgColor(g_Cvar[6], r, g, b)
if (get_pcvar_num(g_Cvar[7]) == 0)
set_hudmessage(r, g, b, x, y, 0, 0.0, HudUpdateInterval, _, _, -1)
else set_hudmessage(random_num(0, 255), random_num(0, 255), random_num(0, 255), x, y, 0, 0.0, HudUpdateInterval, _, _, -1)
ShowSyncHudMsg(id, SyncHudMsg, "%s", buffer)
}
}
public informer_switch(id)
{
if (!get_bit(g_Connected, id) && is_user_ignore(id)) return
if (UserData[id][informer])
{
UserData[id][informer] = 0
client_cmd(id, "spk fvox/activated")
client_print_color(id, print_team_default, "^1[^4LRS^1] ^3Информер ^1<^4Включён^1>")
}
else
{
UserData[id][informer] = 1
client_cmd(id, "spk fvox/deactivated")
client_print_color(id, print_team_default, "^1[^4LRS^1] ^3Информер ^1<^4Выключен^1>")
}
}
#if defined STATUS_VALUE
public StatusValueShow(id)
{
new num = read_data(1)
if (num <= 0 || num >= MAX_TYPES) return
new update = status_value[num] = read_data(2)
switch(num)
{
case TYPE_RELATION:
{
if (!update && is_user_alive(id))
{
message_begin(MSG_ONE_UNRELIABLE, gStatusText, _, id)
write_byte(0); write_string(""); message_end()
}
}
case TYPE_PLAYER:
{
if (is_user_alive(id))
{
new message[192]
switch(status_value[TYPE_RELATION])
{
case LOOK_FRIEND:
{
copy(message, charsmax(message), "Друг: %name%|ХП: %hp%|Ранг: %rank%")
}
case LOOK_ENEMY:
{
copy(message, charsmax(message), "Враг: %name%|Ранг: %rank%")
}
case LOOK_HOSTAGE:
{
return
}
}
EditMessage(message, update, true, get_user_health(update))
message_begin(MSG_ONE_UNRELIABLE, gStatusText, _, id)
write_byte(0); write_string(message); message_end()
}
}
}
}
EditMessage(message[192], player, bool:status_text, hp)
{
new temp[64]
if (is_user_alive(player))
{
for (new i; i < MAX_REPLACES; i ++)
{
switch(i)
{
case RE_HP:
{
num_to_str(hp, temp, charsmax(temp))
}
case RE_RANK:
{
format(temp, charsmax(temp), "%s", CLASSES[UserData[player][level]])
}
case RE_NAME:
{
if (status_text)
copy(temp, charsmax(temp), "%p2")
else
get_user_name(player, temp, charsmax(temp))
}
default:
{
copy(temp, charsmax(temp), "")
}
}
replace(message, charsmax(message), Replaces[i], temp)
}
}
trim(message)
}
#endif
public plugin_natives()
register_native("lrs_get_level_name", "_lrs_get_level_name")
public _lrs_get_level_name(plugin, params)
{
new buffer[192]
new id = get_param(1)
new len = get_param(3)
format(buffer, len, "%s", CLASSES[UserData[id][level]])
set_string(2, buffer, len)
}
stock HudMsgPos(&Float:x, &Float:y)
{
static coords[16], piece[10]
get_pcvar_string(g_Cvar[5], coords, 15)
argbreak(coords, piece, 9, coords, 15)
x = str_to_float(piece)
y = str_to_float(coords)
}
stock HudMsgColor(cvar, &r, &g, &b)
{
static color[16], piece[5]
get_pcvar_string(cvar, color, 15)
argbreak(color, piece, 4, color, 15)
r = str_to_num(piece)
argbreak(color, piece, 4, color, 15)
g = str_to_num(piece)
b = str_to_num(color)
}
#if defined CSSTATSX_SQL
#if defined CSSTATSX_SQL_HUD_SKILL
aes_statsx_get_skill_id(Float:szSkill)
{
for (new i; i < sizeof g_skill_opt; i ++)
{
if (szSkill < g_skill_opt[i])
{
return i
}
}
return (sizeof g_skill_opt - 1)
}
#endif
#endif
is_user_ignore(id)
return is_user_bot(id) || is_user_hltv(id)
не могу понять в чем причина
В этой теме было размещено решение! Перейти к решению.