Raised This Month: $ Target: $400
 0% 

Solved Custom Function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ConorCC
Member
Join Date: Feb 2014
Old 01-01-2022 , 07:23   Custom Function
Reply With Quote #1

Hy there!

Can I create native functions that accept function names as parameters?

Like this...
PHP Code:
register_touch("func_wall""player" "OnPlayerWallTouch"); 
PHP Code:
public OnPlayerWallTouch(const iEntityId, const iId) {} 
Where "OnPlayerWallTouch" is a function's name.

My Case:

The Sub Plugin call this native function.
PHP Code:
RegisterSomething("Anything"1337"MyFunction"); 
The Main Plugins stores this data. Any whenever something happen this will trigger all the functions are registered with "RegisterSomething". In this case "MyFunction" will be called inside of the sub plugin.

Like forwards just not exactly. If something happen in main they notice the sub plugins are subscribed with this function.

Is it cleaner? Thank you!

Edit:

I think I found the solution. I was looking for "callfunc_begin" and "callfunc_end". The only think I have to store the plugin and the function's name.

Last edited by ConorCC; 01-01-2022 at 10:02. Reason: Solution
ConorCC is offline
 


Thread Tools
Display Modes

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 11:29.


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