Пытаюсь отловить звуки шагов в кс 1.6, но естественно движек не дает это сделать в целях безопасности, читал что есть такая возможность в
orpheu, но ничего не получается.
Код:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <orpheu_stocks>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new OrpheuHook:PM_PlaySoundHook
public plugin_init()
{
new OrpheuFunction:PM_Move = OrpheuGetDLLFunction("pfnPM_Move","PM_Move")
OrpheuRegisterHook(PM_Move,"OnPM_Move")
OrpheuRegisterHook(PM_Move,"OnPM_MovePost",OrpheuHookPost)
}
public OnPM_Move(ppmove,server)
{
// Retrieves the address of the function to hook
new PM_PlaySoundAddress = OrpheuGetParamStructMember(1,"PM_PlaySound")
// Creates the function in the module
new OrpheuFunction:PM_PlaySound = OrpheuCreateFunction(PM_PlaySoundAddress,"PM_PlaySound")
// Hooks it
PM_PlaySoundHook = OrpheuRegisterHook(PM_PlaySound,"OnPM_PlaySoundHook")
}
public OnPM_PlaySoundHook(channel,sample[],Float:volume,Float:attenuation,fFlags,pitch)
{
server_print("Sample %s",sample)
}
public OnPM_MovePost(ppmove,server)
{
OrpheuUnregisterHook(PM_PlaySoundHook)
}
Выдает error
Код:
L 10/20/2014 - 18:55:33: [ORPHEU] Invalid function structure "PM_Move"
L 10/20/2014 - 18:55:33: [AMXX] Displaying debug trace (plugin "Untitled.amxx")
L 10/20/2014 - 18:55:33: [AMXX] Run time error 10: native error (native "OrpheuCreateFunction")
L 10/20/2014 - 18:55:33: [AMXX] [0] orpheu_stocks.inc::OrpheuGetDLLFunction (line 59)
L 10/20/2014 - 18:55:33: [AMXX] [1] Untitled.sma::plugin_init (line 16)
Отредактировал: ig0r0k, - 20.10.2014, 17:58