Raised This Month: $45 Target: $400
 11% 

Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cristian505
Senior Member
Join Date: Oct 2020
Location: Romania
Old 12-02-2021 , 16:43   Question
Reply With Quote #1

Let's just say im registering the Ham_IsAlive which starts every 0.1 seconds from what i know. If i register it x2 times in two different plugins their's functions will be called at every 0.1 seconds, i mean x2 0.1 seconds right?
Cristian505 is offline
thEsp
Veteran Member
Join Date: Aug 2017
Old 12-02-2021 , 19:19   Re: Question
Reply With Quote #2

Presuming they're hooked exactly the same then yes they'll be called at the same time (of course one before the other because the game is single-threaded). But the real question here is why are you asking such a question?
thEsp is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 12-02-2021 , 21:36   Re: Question
Reply With Quote #3

if it register from 2 plugins, it will call both function from both plugins at the same time.

It is like using 1 set_task and run function from both plugins instead of 2 set_task on each plugins
__________________
My plugin:
Celena Luna is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-03-2021 , 06:50   Re: Question
Reply With Quote #4

When ham module detects a call to IsAlive, it will notify all plugins that register a hook for this function. So:

PHP Code:
IsAlive() //inside ham module
{
    for 
every registered hook of IsAlive from plugins
        execute corresponding forward in the corresponding plugin

So if 2 plugins execute RegisterHam(Ham_IsAlive) then both forwards will be triggered, one right after the other.
__________________
HamletEagle is offline
Cristian505
Senior Member
Join Date: Oct 2020
Location: Romania
Old 12-11-2021 , 11:35   Re: Question
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
When ham module detects a call to IsAlive, it will notify all plugins that register a hook for this function. So:

PHP Code:
IsAlive() //inside ham module
{
    for 
every registered hook of IsAlive from plugins
        execute corresponding forward in the corresponding plugin

So if 2 plugins execute RegisterHam(Ham_IsAlive) then both forwards will be triggered, one right after the other.
Ok, thanks!
Cristian505 is offline
Cristian505
Senior Member
Join Date: Oct 2020
Location: Romania
Old 12-11-2021 , 11:36   Re: Question
Reply With Quote #6

Quote:
Originally Posted by thEsp View Post
But the real question here is why are you asking such a question?
Curiosity
Cristian505 is offline
Reply


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 05:18.


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