Hide ping command

Сообщения
290
Реакции
28
Помог
2 раз(а)
Is there any plugin or is it possible to create a plugin to hide/block 'ping' command in console for players?
 
Сообщения
278
Реакции
137
AFAIK, you cannot hook "ping" because it is client side command. That's why it is not possible to hide / block that.
 
Сообщения
290
Реакции
28
Помог
2 раз(а)
I know a server running on rehlds that somehow does not return anything when I type ping in console but I dont know how,if it matters I can share ip
Actually look what I found for amxmod , is it possible to made for amxmodx?
Код:
#include <amxmod>
#include <amxmisc>
#include <reapi>

new const PLUGIN_NAME[] = "[ReAPI] ^"status^" & ^"ping^" Commands Blocker"

new const g_iVersionRequired_RH[2] = {1, 0}

public plugin_init() {
    register_plugin(PLUGIN_NAME, "1.0.0", "AMX Mod Dev")

    switch(ReAPI_BF_HasBinaryRunning(ReAPI_BT_ReHLDS, true, g_iVersionRequired_RH[0], g_iVersionRequired_RH[1], true, true)) {
        case 0: {
            log_amx("[%s] Unable to use the plugin, the %s's API is unavailable (the %s engine binary is probably not running).", PLUGIN_NAME, "ReHLDS", "ReHLDS")
            //pause("ae")
            return
        }
        case 1: {
            new iMajorVersion = -1, iMinorVersion = -1
            ReAPI_BF_GetBinaryInformations(ReAPI_BT_ReHLDS, iMajorVersion, iMinorVersion)
            log_amx("[%s] Unable to use the plugin, the %s's API version is lower than the one required (current: v%d.%d, required: v%d.%d).", PLUGIN_NAME, "ReHLDS", "ReHLDS", iMajorVersion, iMinorVersion, g_iVersionRequired_RH[0], g_iVersionRequired_RH[1])
            //pause("ae")
            return
        }
    }

    // Note: Do not use "ValidateCommand" hook!
    ReAPI_HM_AddHookByTypeName(ReAPI_BT_ReHLDS, "ExecuteServerStringCmd", ReAPI_AHCT_Pre1_Alterable, ReAPI_AHPT_Beginning, "HOOK_ExecuteSRVStringCmd_Pre1")
}

public HOOK_ExecuteSRVStringCmd_Pre1(const szCommand[], cmd_source:iCommandSourceType, iPerformerID) {
    // Only allow the server (ID #0) or a real admin to use them.
    if(iCommandSourceType != src_client
    || iPerformerID <= 0
    || is_user_realadmin(iPerformerID)
    || !equali(szCommand, "status") && !equali(szCommand, "ping"))
        return ReAPI_AHRVF_Ignored

    // Hehehehehe!
    console_print(iPerformerID, "Unknown command: %s", szCommand)
    return ReAPI_AHRVF_Supercede
}
 
Последнее редактирование:
Сообщения
290
Реакции
28
Помог
2 раз(а)
Cause 90% of the people coming from boost don't need to know what's their ping ,especially on a mod that doesn't rely on shooting.
 
Сообщения
30
Реакции
48
Помог
2 раз(а)
Players need to know their ping. Question is why you need to keep players with high ping on your server? Also don't forget about net_graph 3.
 
Сообщения
278
Реакции
137
As I said, these commands are not sent to the server, so they are client-side commands and cannot be hooked with libraries like reapi. Orpheu maybe. It would be much better if you fix ping problem instead of trying to hide that commands.
 

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

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