Баг Микро при 3rd (SetView)

Сообщения
673
Реакции
242
Помог
11 раз(а)
данному багу очень много лет
Суть в следующем, при включение Микро а затем вид от 3го лица, то микрофон начинает лагать, якобы фризит
Для наглядности прикрепляю видео (работал с командой voice_loopback 1 and hldj для воспроизведение музыки)


Версия сервера:
Код:
Version:

Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.685-dev
Build date: 16:27:16 Aug 11 2019 (1947)
Build from: https://github.com/dreamstalker/rehlds/commit/5b68568

game version

ReGameDLL version: 5.9.0.369-dev
Build date: 14:12:36 Aug 11 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/fcb5976

meta list

Currently loaded plugins:
      description      stat pend  file                  vers            src  load  unload
 [ 1] VoiceTranscoder  RUN   -    voicetranscoder.dll   v2017RC3        ini  ANY   ANY
 [ 2] Reunion          RUN   -    reunion_mm.dll        v0.1.0.92       ini  Start Never
 [ 3] AMX Mod X        RUN   -    amxmodx_mm.dll        v1.9.0.5249     ini  Start ANY
 [ 4] FakeMeta         RUN   -    fakemeta_amxx.dll     v1.9.0.5249     pl3  ANY   ANY
 [ 5] MySQL            RUN   -    mysql_amxx.dll        v1.9.0.5249     pl3  ANY   ANY
 [ 6] ReAPI            RUN   -    reapi_amxx.dll        v5.9.0.178-dev  pl3  ANY   Never
 [ 7] CSX              RUN   -    csx_amxx.dll          v1.9.0.5249     pl3  ANY   ANY
 [ 8] Ham Sandwich     RUN   -    hamsandwich_amxx.dll  v1.9.0.5249     pl3  ANY   ANY
8 plugins, 8 running

amxx plugins

       name                    version     author            file             status
 [  1] FreshBans               1.4.0b      kanagava          fresh_bans_140_  running
 [  2] Admin Loader            3.5         neygomon          admin_loader_3.  running
 [  3] Admin Commands          1.9.0.5232  AMXX Dev Team     admincmd.amxx    running
 [  4] Admin Help              1.9.0.5232  AMXX Dev Team     adminhelp.amxx   running
 [  5] Slots Reservation       1.9.0.5232  AMXX Dev Team     adminslots.amxx  running
 [  6] Multi-Lingual System    1.9.0.5232  AMXX Dev Team     multilingual.am  running
 [  7] Menus Front-End         1.9.0.5232  AMXX Dev Team     menufront.amxx   running
 [  8] Commands Menu           1.9.0.5232  AMXX Dev Team     cmdmenu.amxx     running
 [  9] Players Menu            1.9.0.5249  AMXX Dev Team     plmenu.amxx      running
 [ 10] Maps Menu               1.9.0.5232  AMXX Dev Team     mapsmenu.amxx    running
 [ 11] Plugin Menu             1.9.0.5232  AMXX Dev Team     pluginmenu.amxx  running
 [ 12] Admin Chat              1.9.0.5232  AMXX Dev Team     adminchat.amxx   running
 [ 13] Anti Flood              1.9.0.5232  AMXX Dev Team     antiflood.amxx   running
 [ 14] Scrolling Message       1.9.0.5232  AMXX Dev Team     scrollmsg.amxx   running
 [ 15] Info. Messages          1.9.0.5232  AMXX Dev Team     imessage.amxx    running
 [ 16] Admin Votes             1.9.0.5232  AMXX Dev Team     adminvote.amxx   running
 [ 17] NextMap                 1.9.0.5232  AMXX Dev Team     nextmap.amxx     running
 [ 18] Nextmap Chooser         1.9.0.5232  AMXX Dev Team     mapchooser.amxx  running
 [ 19] TimeLeft                1.9.0.5232  AMXX Dev Team     timeleft.amxx    running
 [ 20] Pause Plugins           1.9.0.5232  AMXX Dev Team     pausecfg.amxx    running
 [ 21] Stats Configuration     1.9.0.5232  AMXX Dev Team     statscfg.amxx    running
 [ 22] StatsX                  1.9.0.5249  AMXX Dev Team     statsx.amxx      running
 [ 23] Camera View Menu        0.0.3       ConnorMcLeod & N  camera.amxx      running
23 plugins, 23 running
Использованный плагин для вид от 3го лица
Код:
/* BIG CREDITS FOR ConnorMcLeod
I Only just modified the front camera and added a scale controlled by a player, so he can zoom in/out! & added a menu*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.3"

#define USE_TOGGLE 3

#define MAX_BACKWARD_UNITS    -200.0
#define MAX_FORWARD_UNITS    200.0

new g_iPlayerCamera[33], Float:g_camera_position[33];

public plugin_init()
{
    register_plugin("Camera View Menu", VERSION, "ConnorMcLeod & Natsheh")
    
    register_clcmd("say /cam", "camera_menu")
    register_clcmd("say_team /cam", "camera_menu")
    
    register_forward(FM_SetView, "SetView")
    RegisterHam(Ham_Think, "trigger_camera", "Camera_Think")
}

public camera_menu(id)
{
    if(!is_user_alive(id))
    {
        return 1;
    }
    
    new menu = menu_create("Choose an option!", "cam_m_handler"), sText[48], bool:mode = (g_iPlayerCamera[id] > 0) ? true:false;
    
    formatex(sText, charsmax(sText), "%s \r3RD Person camera!", (mode) ? "\dDisable":"\yEnable")
    menu_additem(menu, sText)
    
    if(mode)
    {
        menu_additem(menu, "Forward Further!")
        menu_additem(menu, "Backward Further!")
    }
    
    menu_display(id, menu)
    return 1;
}

public cam_m_handler(id, menu, item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return 1;
    }
    
    menu_destroy(menu);
    
    if(g_iPlayerCamera[id] > 0 && item == 0)
    {
        new iEnt = g_iPlayerCamera[id];
        if(pev_valid(iEnt)) engfunc(EngFunc_RemoveEntity, iEnt);
        g_iPlayerCamera[id] = 0;
        g_camera_position[id] = -100.0;
        engfunc(EngFunc_SetView, id, id);
    }
    else
    {
        switch( item )
        {
            case 0:
            {
                g_camera_position[id] = -150.0;
                enable_camera(id)
            }
            case 1: if(g_camera_position[id] < MAX_FORWARD_UNITS) g_camera_position[id] += 50.0;
            case 2: if(g_camera_position[id] > MAX_BACKWARD_UNITS) g_camera_position[id] -= 50.0;
        }
    }
    
    camera_menu(id)
    return 1;
}

public enable_camera(id)
{
    if(!is_user_alive(id)) return;
    
    new iEnt = g_iPlayerCamera[id]
    if(!pev_valid(iEnt))
    {
        static iszTriggerCamera
        if( !iszTriggerCamera )
        {
            iszTriggerCamera = engfunc(EngFunc_AllocString, "trigger_camera")
        }
        
        iEnt = engfunc(EngFunc_CreateNamedEntity, iszTriggerCamera);
        set_kvd(0, KV_ClassName, "trigger_camera")
        set_kvd(0, KV_fHandled, 0)
        set_kvd(0, KV_KeyName, "wait")
        set_kvd(0, KV_Value, "999999")
        dllfunc(DLLFunc_KeyValue, iEnt, 0)
    
        set_pev(iEnt, pev_spawnflags, SF_CAMERA_PLAYER_TARGET|SF_CAMERA_PLAYER_POSITION)
        set_pev(iEnt, pev_flags, pev(iEnt, pev_flags) | FL_ALWAYSTHINK)
    
        dllfunc(DLLFunc_Spawn, iEnt)
    
        g_iPlayerCamera[id] = iEnt;
 //   }     
        new Float:flMaxSpeed, iFlags = pev(id, pev_flags)
        pev(id, pev_maxspeed, flMaxSpeed)
        
        ExecuteHam(Ham_Use, iEnt, id, id, USE_TOGGLE, 1.0)
        
        set_pev(id, pev_flags, iFlags)
        // depending on mod, you may have to send SetClientMaxspeed here.
        // engfunc(EngFunc_SetClientMaxspeed, id, flMaxSpeed)
        set_pev(id, pev_maxspeed, flMaxSpeed)
    }
}

public SetView(id, iEnt)
{
    if(is_user_alive(id))
    {
        new iCamera = g_iPlayerCamera[id]
        if( iCamera && iEnt != iCamera )
        {
            new szClassName[16]
            pev(iEnt, pev_classname, szClassName, charsmax(szClassName))
            if(!equal(szClassName, "trigger_camera")) // should let real cams enabled
            {
                engfunc(EngFunc_SetView, id, iCamera) // shouldn't be always needed
                return FMRES_SUPERCEDE
            }
        }
    }
    return FMRES_IGNORED
}

public client_disconnected(id)
{
    new iEnt = g_iPlayerCamera[id];
    if(pev_valid(iEnt)) engfunc(EngFunc_RemoveEntity, iEnt);
    g_iPlayerCamera[id] = 0;
    g_camera_position[id] = -100.0;
}

public client_putinserver(id)
{
    g_iPlayerCamera[id] = 0
    g_camera_position[id] = -100.0;
}

get_cam_owner(iEnt)
{
    new players[32], pnum;
    get_players(players, pnum, "ch");
    
    for(new id, i; i < pnum; i++)
    {
        id = players[i];
        
        if(g_iPlayerCamera[id] == iEnt)
        {
            return id;
        }
    }
    
    return 0;
}

public Camera_Think(iEnt)
{
    static id;
    if(!(id = get_cam_owner(iEnt))) return ;
    
    static Float:fVecPlayerOrigin[3], Float:fVecCameraOrigin[3], Float:fVecAngles[3], Float:fVec[3];
    
    pev(id, pev_origin, fVecPlayerOrigin)
    pev(id, pev_view_ofs, fVecAngles)
    fVecPlayerOrigin[2] += fVecAngles[2]
    
    pev(id, pev_v_angle, fVecAngles)
    
    angle_vector(fVecAngles, ANGLEVECTOR_FORWARD, fVec);
    static Float:units; units = g_camera_position[id];
    
    //Move back/forward to see ourself
    fVecCameraOrigin[0] = fVecPlayerOrigin[0] + (fVec[0] * units)
    fVecCameraOrigin[1] = fVecPlayerOrigin[1] + (fVec[1] * units)
    fVecCameraOrigin[2] = fVecPlayerOrigin[2] + (fVec[2] * units) + 15.0
    
    static tr2; tr2 = create_tr2();
    engfunc(EngFunc_TraceLine, fVecPlayerOrigin, fVecCameraOrigin, IGNORE_MONSTERS, id, tr2)
    static Float:flFraction
    get_tr2(tr2, TR_flFraction, flFraction)
    if( flFraction != 1.0 ) // adjust camera place if close to a wall
    {
        flFraction *= units;
        fVecCameraOrigin[0] = fVecPlayerOrigin[0] + (fVec[0] * flFraction);
        fVecCameraOrigin[1] = fVecPlayerOrigin[1] + (fVec[1] * flFraction);
        fVecCameraOrigin[2] = fVecPlayerOrigin[2] + (fVec[2] * flFraction);
    }
    
    if(units > 0.0)
    {
        fVecAngles[0] *= fVecAngles[0] > 180.0 ? 1:-1
        fVecAngles[1] += fVecAngles[1] > 180.0 ? -180.0:180.0
    }
    
    set_pev(iEnt, pev_origin, fVecCameraOrigin);
    set_pev(iEnt, pev_angles, fVecAngles);
    
    free_tr2(tr2);
}
 

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

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