Не верный показ say/me

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
460
Реакции
68
Помог
7 раз(а)
Ошибка
Не верный показ say/me
Скрины см. ниже
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (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: Oct 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.693-dev
Build date: 18:20:58 Jan 28 2020 (2117)
Build from: https://github.com/dreamstalker/rehlds/commit/c4cecf5
ReGamedll
ReGameDLL version: 5.13.0.447-dev+m
Build date: 18:11:04 Jan 15 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/2eba3b1
Версия 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] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC4 ini ANY ANY
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 7] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 8] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.12.0.192-dev pl4 ANY Never
[10] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[11] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl4 ANY ANY
[12] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[13] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[14] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl4 ANY ANY
15 plugins, 15 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] FreshBans 1.4.2b kanagava fresh_bans_142_ running
[ 2] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 3] Aliases checker 1.0.3 kanagava alias_detector. running
[ 4] ScreenMaker 1.1 neygomon screen_maker.am running
[ 5] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am debug
[ 6] RC BaseChanger freesrv custom rc_basechanger. stopped
[ 7] ReChecker Logging freesrv custom rc_logging.amxx running
[ 8] Lite Admin ESP 1.1 neygomon, AcE admin_esp_ace.a running
[ 9] Admin Base 1.9.0.5263 AMXX Dev Team admin.amxx running
[ 10] Ping Control 1.31f neygomon(+wopox ping_control_wo running
[ 11] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 12] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 13] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 14] Stats Configuration 1.10.0.525 AMXX Dev Team statscfg.amxx running
[ 15] Advanced Gag 1.9.0 neygomon amx_gag.amxx running
[ 16] Maps Menu 1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 17] Server Menu 1.5.0 F@nt0M server_menu.amx running
[ 18] Parachute 1.1 ReHLDS Team Parachute_ReHLD running
[ 19] Demo Recorder 2.4.1 F@nt0M demo_recorder.a running
[ 20] Rock to Ban 1.02 Safety1st rock2ban.amxx running
[ 21] Players Menu 1.7 neugomon players_menu.am running
[ 22] [ReAPI] Kills Counter 0.3 serfreeman1337 kills_counter.a running
[ 23] Killer ScreenFade 0.0.5 Vaqtincha reapi_killer_sc running
[ 24] Damager 0.0.6 steelzzz damager.amxx running
[ 25] SF Warn Menu 0.1.4g serfreeman1337 sf_admin_warns. running
[ 26] AES: StatsX Info Rank 0.1 serfreeman1337 aes_statsx_rank running
[ 27] Adverts 1.0 pUzzlik adverts_message running
[ 28] KiLL Assist poka_4to_b PRoSToTeM@ Kill_assist_rea running
[ 29] Multiple Game Names дата автор mgn.amxx running
[ 30] Vzruv Golovu 1.0 eL vzruv_golovu.am running
[ 31] AntiFlood Change Name 28.11.2018 sergrib AntiFlood_Chang running
[ 32] [ReAPI] Random Weapons 2.4.9 neugomon/h1k3 Random_Weapons_ running
[ 33] SF Bets 0.1.5 serfreeman1337 sf_bets.amxx running
[ 34] Radio Hudmsg Block 1.0 AcE radio_hudmsg_bl running
[ 35] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 36] Advanced MapChooser 1.4 neygomon map_chooser.amx running
[ 37] [ReAPI] No Team Flash 0.0.2 Vaqtincha no_team_flash.a running
[ 38] Items Restrict 1.0 s1lent items_restrict. running
[ 39] Mode 2x2 2.5re s1lent mode.amxx running
[ 40] resetscore(ReAPI) 1.0 Phantom resetscore.amxx running
[ 41] Me Hp StatsX 1.35 AMXX Dev Team me_hp_statsx.am running
[ 42] Lite Translit 2.8 neygomon lite_translit_c running
[ 43] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 44] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 45] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 46] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. debug
[ 47] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 48] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri running
[ 49] V.I.P Custom Weapons 1.0.0 Vaqtincha vip_custom.amxx running
[ 50] V.I.P Custom DEAGLE 1.0.0 Vaqtincha custom_deagle.a running
[ 51] V.I.P Custom M4A1 1.0.0 Vaqtincha custom_m4a1.amx running
[ 52] V.I.P Custom AK-47 1.0.0 Vaqtincha custom_ak47.amx running
[ 53] V.I.P Custom AWP 1.0.0 Vaqtincha custom_awp.amxx running
53 plugins, 52 running
Автор плагина
AMXX Dev Team
Версия плагина
Версия: 1.35
Исходный код
// Modified by sonikplus

// vim: set ts=4 sw=4 tw=99 noet:
//
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
// Copyright (C) The AMX Mod X Development Team.
//
// This software is licensed under the GNU General Public License, version 3 or higher.
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
// https://alliedmods.net/amxmodx-license
//--------------------------------

#include <amxmodx>
#include <csx>
#include <hamsandwich>

#define BLOCK_FOR_ALIVE // say /me can be used only by dead
#define NEED_STATSCFG // possibility to enable/disable commands /me, /hp in the amx_statscfgmenu
//#define END_ROUND_SAY_ME // say /me at the end of round
//#define BETA_ME // new beta me
#define KILL_HE_FIX // only if used CSstatsX SQL

#if AMXX_VERSION_NUM < 183
#include <colorchat>

#define print_team_default DontChange
#define print_team_grey Grey
#define print_team_red Red
#define print_team_blue Blue
#endif

// You can also manualy enable or disable these options by setting them to 1
// For example:
// public KillerChat = 1
// However amx_statscfg command is recommended
#if defined NEED_STATSCFG
public KillerChat = 0 // displays killer hp&ap to victim console and screen
public SayHP = 0 // displays information about user killer
public SayMe = 0 // displays user's stats
#endif

// Standard Contstants.
#if !defined MAX_PLAYERS
#define MAX_PLAYERS 32
#endif

#if !defined MAX_NAME_LENGTH
#define MAX_NAME_LENGTH 31
#endif

#define MAX_SHORT_WPN_NAME_LENGTH 10 // fiveseven = 9
#define MAX_BUFFER_LENGTH 190

// User stats parms id
#define STATS_KILLS 0
//#define STATS_DEATHS 1
#define STATS_HS 2
//#define STATS_TKS 3
//#define STATS_SHOTS 4
#define STATS_HITS 5
#define STATS_DAMAGE 6

// Global player flags.
new BODY_PART[8][] =
{
"ML_WHOLEBODY",
"ML_HEAD",
"ML_CHEST",
"ML_STOMACH",
"ML_LEFTARM",
"ML_RIGHTARM",
"ML_LEFTLEG",
"ML_RIGHTLEG"
}

// Killer information, save killer info at the time when player is killed.
#define KILLED_KILLER_ID 0 // Killer userindex/user-ID
#define KILLED_KILLER_HEALTH 1 // Killer's health
#define KILLED_KILLER_ARMOUR 2 // Killer's armour
#define KILLED_HE_FIX 3 // Fix to register kill with grenade

new g_izKilled[MAX_PLAYERS + 1][4]

new g_izUserAttackerDistance[MAX_PLAYERS + 1] = {0, ...}

// Common buffer to improve performance, as Small always zero-initializes all vars
new g_sBuffer[MAX_BUFFER_LENGTH + 1] = ""
new t_sName[MAX_NAME_LENGTH + 1] = ""
new t_sWpn[MAX_SHORT_WPN_NAME_LENGTH + 1] = ""

#if defined BETA_ME
new g_szLastVictim[MAX_PLAYERS + 1][MAX_NAME_LENGTH + 1]
#endif

public plugin_init()
{
// Register plugin.
register_plugin("Me Hp StatsX", "1.35", "AMXX Dev Team")
register_dictionary("me_hp_statsx.txt")

RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", .Post = true)

#if defined KILL_HE_FIX
register_event("DeathMsg", "Event_Death", "a", "4&gren")
#endif

#if defined END_ROUND_SAY_ME
register_logevent("Logevent_Round_End", 2, "1=Round_End")
#endif

// Register commands.
register_clcmd("say /hp", "cmdHp", 0, "- display info. about your killer (chat)")
register_clcmd("say /me", "cmdMe", 0, "- display current round stats (chat)")
register_clcmd("say_team /hp", "cmdHp", 0, "- display info. about your killer (chat)")
register_clcmd("say_team /me", "cmdMe", 0, "- display current round stats (chat)")

g_sBuffer[0] = 0
}

#if defined KILL_HE_FIX
public Event_Death()
{
new iKiller, iVictim;
iKiller = read_data(1);
iVictim = read_data(2);
static iMaxClients;

if (!iMaxClients)
iMaxClients = get_maxplayers();

client_death(iKiller > iMaxClients ? 0 : iKiller, iVictim, CSW_HEGRENADE, 0, 0);
}
#endif

#if defined NEED_STATSCFG
public plugin_cfg()
{
new addStast[] = "amx_statscfg add ^"%s^" %s"

server_cmd(addStast, "ST_SHOW_KILLER_CHAT", "KillerChat");
server_cmd(addStast, "ST_SAY_HP", "SayHP");
server_cmd(addStast, "ST_SAY_ME", "SayMe");
}
#endif

// Distance formula (metric)
Float:distance(iDistance)
{
return float(iDistance) * 0.0254
}

// Reset killer info on round restart.
public fwHamPlayerSpawnPost(id)
{
// Reset round stats
g_izKilled[id][KILLED_KILLER_ID] = 0
g_izUserAttackerDistance[id] = 0
}

#if defined END_ROUND_SAY_ME
public Logevent_Round_End()
{
set_task(1.0, "EndRoundSayMe")
}

public EndRoundSayMe()
{
new iPlayers[32], iNum;
get_players(iPlayers, iNum, "ch");
for(new i; i < iNum; i++)
{
#if defined BETA_ME
if(format_user_rstats(iPlayers[i], g_sBuffer))
#else
if(format_kill_vinfo(iPlayers[i], 0, g_sBuffer))
#endif
client_print_color(iPlayers[i], print_team_blue, "%s", g_sBuffer)
}
}
#endif

// Save killer info on death.
public client_death(killer, victim, wpnindex, hitplace, TK)
{
// Bail out if no killer.
if (killer && killer != victim)
{
#if defined BETA_ME
get_user_name(victim, g_szLastVictim[killer], charsmax(g_szLastVictim[]))
#endif
new iaVOrigin[3], iaKOrigin[3];

get_user_origin(victim, iaVOrigin)
get_user_origin(killer, iaKOrigin)

g_izKilled[victim][KILLED_KILLER_ID] = killer
g_izKilled[victim][KILLED_KILLER_HEALTH] = get_user_health(killer);
g_izKilled[victim][KILLED_KILLER_ARMOUR] = get_user_armor(killer);

g_izKilled[victim][KILLED_HE_FIX] = wpnindex == CSW_HEGRENADE ? 1 : 0;

g_izUserAttackerDistance[victim] = get_distance(iaVOrigin, iaKOrigin);

// Display kill stats for the player
#if defined NEED_STATSCFG
if (!KillerChat)
return PLUGIN_CONTINUE
#endif
if (format_kill_ainfo(victim, killer, g_sBuffer))
{
client_print_color(victim, print_team_blue, "%s", g_sBuffer)
format_kill_vinfo(victim, killer, g_sBuffer)
}
client_print_color(victim, print_team_blue, "%s", g_sBuffer)
}
return PLUGIN_CONTINUE
}

// Display killer information.
public cmdHp(id)
{
#if defined NEED_STATSCFG
if (!SayHP)
{
client_print_color(id, print_team_default, "%L", id, "ML_DISABLED_MSG")
return PLUGIN_HANDLED
}
#endif

format_kill_ainfo(id, g_izKilled[id][KILLED_KILLER_ID], g_sBuffer)
client_print_color(id, print_team_blue, "%s", g_sBuffer)

return PLUGIN_CONTINUE
}

// Display user stats.
public cmdMe(id)
{
#if defined NEED_STATSCFG
if (!SayMe)
{
client_print_color(id, print_team_default, "%L", id, "ML_DISABLED_MSG")
return PLUGIN_HANDLED
}
#endif

#if defined BLOCK_FOR_ALIVE
if (!is_user_alive(id))
{
client_print_color(id, print_team_default, "%L", id, "ML_CANT_BE_USED_NOW")
return PLUGIN_HANDLED
}
#endif

#if defined BETA_ME
format_user_rstats(id, g_sBuffer)
#else
format_kill_vinfo(id, 0, g_sBuffer)
#endif
client_print_color(id, print_team_blue, "%s", g_sBuffer)

return PLUGIN_CONTINUE
}

// Get and format killed stats: killer hp, ap, hits.
format_kill_ainfo(id, iKiller, sBuffer[MAX_BUFFER_LENGTH + 1])
{
new iFound = 0;

if (iKiller && iKiller != id)
{
new izStats[8], izBody[8];
new iLen;

iFound = 1

get_user_name(iKiller, t_sName, charsmax(t_sName))

get_user_astats(id, iKiller, izStats, izBody, t_sWpn, charsmax(t_sWpn))

iLen = formatex(sBuffer, charsmax(sBuffer), "%L ^1(^4%d^3HP,^4%d^3AP^1) >", id, "ML_KILLED_BY_WITH", t_sName, g_izKilled[id][KILLED_HE_FIX] ? "grenade" : t_sWpn,
distance(g_izUserAttackerDistance[id]), g_izKilled[id][KILLED_KILLER_HEALTH], g_izKilled[id][KILLED_KILLER_ARMOUR]);

if (izStats[STATS_HITS])
{
for (new i = 1; i < sizeof(izBody); i++)
{
if (!izBody[i])
continue;

iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, " ^4%L:^3%d", id, BODY_PART[i], izBody[i]);
}
}
else
formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, " %L", id, "ML_NO_HITS");
}
else
formatex(sBuffer, charsmax(sBuffer), "%L", id, "ML_YOU_NO_KILLER");

return iFound;
}

// Get and format killed stats: hits, damage on killer.
format_kill_vinfo(id, iKiller, sBuffer[MAX_BUFFER_LENGTH + 1])
{
new iFound = 0;
new izStats[8], izBody[8];
new iLen;

get_user_vstats(id, iKiller, izStats, izBody);

if (iKiller && iKiller != id)
{
iFound = 1;
get_user_name(iKiller, t_sName, charsmax(t_sName));
iLen = formatex(sBuffer, charsmax(sBuffer), "%L >", id, "ML_YOU_HIT", t_sName, izStats[STATS_HITS], izStats[STATS_DAMAGE]);
}
else
{
new iDamage = izStats[STATS_DAMAGE];
iLen = formatex(sBuffer, charsmax(sBuffer), "%L >", id, "ML_LAST_RES", iDamage, izStats[STATS_HITS]);
iFound = iDamage ? 1 : 0;
}

if (izStats[STATS_HITS])
{
for (new i = 1; i < sizeof(izBody); i++)
{
if (!izBody[i])
continue;

iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, " ^4%L:^3%d", id, BODY_PART[i], izBody[i]);
}
}
else
formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, " %L", id, "ML_NO_HITS");

return iFound;
}

#if defined BETA_ME
format_user_rstats(id, sBuffer[MAX_BUFFER_LENGTH + 1])
{
#define HEAD 1
new izStats[8], izBody[8];
get_user_rstats(id, izStats, izBody); /* Gets round stats of player. */

new iLen = formatex(sBuffer, charsmax(sBuffer), "%L", id, "ML_LAST_STATS", izStats[STATS_KILLS], izStats[STATS_DAMAGE], izStats[STATS_HITS], izBody[HEAD]);

if (izStats[STATS_KILLS])
formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, " %L", id, "ML_LAST_VICTIM", g_szLastVictim[id]);

return izStats[STATS_DAMAGE];
}
#endif
Всем привет форумчане. Столкнулся с маленькой траблой. И так показ /me игроку выводится неверно то есть когда я жив он его показывает а когда мёртв пишет в чат обратное. Смотрите скрины ниже.
Хотя на странице плагина указано обратное.
1. Скрин я мёртв.
2. Скрин я жив.

20698
20697

На всякий приложу txt.
 
В этой теме было размещено решение! Перейти к решению.

Download all Attachments

Последнее редактирование:
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
Код:
    #if defined BLOCK_FOR_ALIVE
    if (!is_user_alive(id))
    {
        client_print_color(id, print_team_default, "%L", id, "ML_CANT_BE_USED_NOW")
        return PLUGIN_HANDLED
    }
    #endif
Тут просто условие наоборот сделать: if (is_user_alive(id))
 
Сообщения
460
Реакции
68
Помог
7 раз(а)
w0w, Спасибо большое за помощь. Я не внимателен. Хотя смотрел похожий участок с другого плагина и не увидел восклицательного знака :D
C++:
Вот похожий ыыы

        case SayMe:
        {
            if (is_user_alive(id) && !get_pcvar_num(g_Cvar[0]))
                client_print_color(id, print_team_default, "^1[^4SayMe^1] ^3Команда доступна только мёртвым ^4игрокам^3!")
            else
 
Статус
В этой теме нельзя размещать новые ответы.

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

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