Raised This Month: $32 Target: $400
 8% 

Solved Custom Function


Post New Thread Reply   
 
Thread Tools Display Modes
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
Old 01-01-2022, 08:47
Natsheh
This message has been deleted by Natsheh. Reason: Nvm the author doesn't know wtf he wants
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-01-2022 , 17:22   Re: Custom Function
Reply With Quote #2

It sounds like maybe MultiFowards would be something that you should consider using instead.
__________________
fysiks is offline
ConorCC
Member
Join Date: Feb 2014
Old 01-02-2022 , 06:41   Re: Custom Function
Reply With Quote #3

I was looking for something that call a function in one plugin only. This can be done with "callfunc_" BUT the link in your post just helped me to realize there is an another option to avoid this. "CreateOneForward" that I haven't seen this in plugins so I didn't even know this exists.

So Thank you again, this will be much better I think!
ConorCC 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 06:04.


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