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

Using another way of calling functions instead of callfunc_*


Post New Thread Reply   
 
Thread Tools Display Modes
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-11-2010 , 03:56   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #21

Quote:
Originally Posted by Exolent[jNr] View Post
If you didn't continue to ignore my link then you would know.
I already read it but wasnt able to find any thing related to Fake Forwards ::
Maybe you can give a little summary of what it is
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-11-2010 , 04:06   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #22

Creating a forward with those functions can be called fake or dynamic forwards.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-11-2010 , 05:28   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #23

So you call functions without any params ?

Then what don't you make a single fake native with 1 integer param that is used to call the right function ?

I may have missed something on that thread but i don't see any reason to implement forwards.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-11-2010 , 08:33   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #24

Quote:
Originally Posted by ConnorMcLeod View Post
So you call functions without any params ?

Then what don't you make a single fake native with 1 integer param that is used to call the right function ?

I may have missed something on that thread but i don't see any reason to implement forwards.
i have only should a simlified example, obv. i will add support for dynamic number ov parametres
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-11-2010 , 18:30   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #25

Is the native created in the same plugin that contains these functions you are trying to execute? (the ones that you changed from stock to public)

If yes, then you don't need to do any callfunc stuff.

Here is a quick implementation if the answer is yes (not sure it it would be more simple, it's just one way that came to mind):


PHP Code:
#define FUNC_DOSOMETHING1 1
#define FUNC_DOSOMETHING2 2
#define FUNC_DOSOMETHING3 3


public _super_native(iPluginiParams)
{
    new 
iFunc /* get func param */
    
    
switch( iFunc )
    {
        case 
FUNC_DOSOMETHING1:
        {
            
function_do_something1()
        }
        case 
FUNC_DOSOMETHING2:
        {
            
function_do_something2()
        }
        
// etc.
    
}

Other Plugin:
PHP Code:
#define FUNC_DOSOMETHING1 1
#define FUNC_DOSOMETHING2 2
#define FUNC_DOSOMETHING3 3

// ...

    
super_native(FUNC_DOSOMETHING1)
    
// function_do_something1() was executed. 
__________________

Last edited by fysiks; 12-11-2010 at 18:38.
fysiks is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-12-2010 , 02:44   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #26

Quote:
Originally Posted by fysiks View Post
Is the native created in the same plugin that contains these functions you are trying to execute? (the ones that you changed from stock to public)

If yes, then you don't need to do any callfunc stuff.

Here is a quick implementation if the answer is yes (not sure it it would be more simple, it's just one way that came to mind):


PHP Code:
#define FUNC_DOSOMETHING1 1
#define FUNC_DOSOMETHING2 2
#define FUNC_DOSOMETHING3 3


public _super_native(iPluginiParams)
{
    new 
iFunc /* get func param */
    
    
switch( iFunc )
    {
        case 
FUNC_DOSOMETHING1:
        {
            
function_do_something1()
        }
        case 
FUNC_DOSOMETHING2:
        {
            
function_do_something2()
        }
        
// etc.
    
}

Other Plugin:
PHP Code:
#define FUNC_DOSOMETHING1 1
#define FUNC_DOSOMETHING2 2
#define FUNC_DOSOMETHING3 3

// ...

    
super_native(FUNC_DOSOMETHING1)
    
// function_do_something1() was executed. 
Ya i understood what you meant, i will also be implementing a native like pev, to do the job
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
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 22:16.


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