Raised This Month: $51 Target: $400
 12% 

Call game functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 12-01-2014 , 18:53   Call game functions
Reply With Quote #1

AMX MOD X has a powerful module that allows you to call / hook game functions, among many other obscene things. Its called Orpheu https://forums.alliedmods.net/showthread.php?t=116393.

For example, you can hook

PHP Code:
void CBaseMonster :: RadiusDamage(entvars_tpevInflictorentvars_tpevAttackerfloat flDamageint iClassIgnoreint bitsDamageType 
with a simple plugin,

PHP Code:
public plugin_init( )
{
    
// ...
    
OrpheuRegisterHookOrpheuGetFunction"RadiusDamage""CBaseMonster" ), "On_RadiusDamage_Pre"OrpheuHookPre )
}

public 
OrpheuHookReturn:On_RadiusDamage_PrepevCallerpevInflictorpevAttackerFloat:flDamageiClassIgnorebitsDamageType )
{
    
// ...
    
return OrpheuSupercede

I am writing this message to ask if there is any way to do this in SourceMod. I want to call some CS:GO functions.
__________________
PM for help = ignore

Last edited by guipatinador; 12-01-2014 at 18:54.
guipatinador is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 12-01-2014 , 18:57   Re: Call game functions
Reply With Quote #2

this explains
arthurdead is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 12-01-2014 , 18:59   Re: Call game functions
Reply With Quote #3

Thanks. Will take a look.
__________________
PM for help = ignore
guipatinador is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-01-2014 , 20:29   Re: Call game functions
Reply With Quote #4

You mention calling functions, but in your example, you're hooking one. The wiki article linked by arthurdead is where to start for calling. For hooking virtual functions, there is a third-party extension, DHooks https://forums.alliedmods.net/showthread.php?t=180114

There are also many entity/player functions already premade as hookable in the SDKHooks extension which is bundled with SourceMod.
psychonic is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode