jiangwe5082 发表于 2017-5-5 10:50:32

懂orpheu模块的大神进来下!

#include <amxmodx>
#include <orpheu>
#include <orpheu_memory>

#define PLUGIN"Fix RoundTimer"
#define AUTHOR"Rirre/Arkshine"
#define VERSION "1.1"

enum GameRulesMembers
{
        m_iRoundTimeSecs,
        m_flRoundCount
};

new const GameRulesMI[ GameRulesMembers ][] =
{
        "m_iRoundTimeSecs",
        "m_flRoundCount"
};

new g_pGameRules;
new g_c4timer, mp_c4timer;

#define set_mp_pdata(%1,%2)( OrpheuMemorySetAtAddress( g_pGameRules, GameRulesMI[ %1 ], 1, %2 ) )
#define get_mp_pdata(%1)   ( OrpheuMemoryGetAtAddress( g_pGameRules, GameRulesMI[ %1 ] ) )

public plugin_precache() OrpheuRegisterHook( OrpheuGetFunction( "InstallGameRules" ), "OnInstallGameRules", OrpheuHookPost );

public OnInstallGameRules() g_pGameRules = OrpheuGetReturn();

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
        register_logevent("PlantedBomb", 3, "2=Planted_The_Bomb");
       
        mp_c4timer = get_cvar_pointer("mp_c4timer");
}

public plugin_cfg() g_c4timer = get_pcvar_num(mp_c4timer);

public PlantedBomb() setRoundTime( g_c4timer );

setRoundTime( const newTime )
{
        set_mp_pdata( m_iRoundTimeSecs, newTime );
        set_mp_pdata( m_flRoundCount, get_gametime() );
       
        static msgIndexRoundTime;
       
        if( msgIndexRoundTime || ( msgIndexRoundTime = get_user_msgid( "RoundTime" ) ) )
        {
                message_begin( MSG_ALL, msgIndexRoundTime );
                write_short( newTime );
                message_end();
        }
}

L 05/05/2017 - 10:31:12: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20170505.log")
L 05/05/2017 - 10:31:12: Function "InstallGameRules" not found
L 05/05/2017 - 10:31:12: Displaying debug trace (plugin "Fix_RoundTimer.amxx")
L 05/05/2017 - 10:31:12: Run time error 10: native error (native "OrpheuGetFunction")
L 05/05/2017 - 10:31:12:     Fix_RoundTimer.sma::plugin_precache (line 27)

哪地方出错了啊 哪位大神能帮帮我 研究好长时间了 也没找到问题
ORPHEU模块也配置了

丶某人的痛才是 发表于 2017-5-6 19:51:10

你确定是否orpheu模块加载了???

jiangwe5082 发表于 2017-5-7 20:03:48

丶某人的痛才是 发表于 2017-5-6 19:51
你确定是否orpheu模块加载了???

大神 orpheu模块支持1.5麽

丶某人的痛才是 发表于 2017-5-13 15:13:27

jiangwe5082 发表于 2017-5-7 20:03
大神 orpheu模块支持1.5麽

不支持,建议1.6吧
页: [1]
查看完整版本: 懂orpheu模块的大神进来下!