Raised This Month: $ Target: $400
 0% 

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-10-2010 , 14:10   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #11

Quote:
Originally Posted by fysiks View Post
You should look in other API like plugins and see how it's done.
Right now i will also add Multi functional natives like arkshine suggested and as well as a native through which you can execute any public function with its name, this will make my plugin's API more flexbile
__________________

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
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-10-2010 , 14:40   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #12

And what about CreateOneForward?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-10-2010 , 15:15   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #13

Quote:
Originally Posted by meTaLiCroSS View Post
And what about CreateOneForward?
Provide me little info about that PLZ

@Others: If i change some stock functions and some private functions to public ones, it wont affect any thing, right ?? Coz i need to be care ful in making this plugin
__________________

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-10-2010 , 16:00   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #14

http://forums.alliedmods.net/showthread.php?t=41241
__________________
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-10-2010 , 16:03   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #15

I may be wrong because that stuff is too high level for me, but i feel that callfuncbegin should be faster with the function ID than with the function name, because each time you pass name, amxx has to retrieve corresponding ID, but i may be wrong.
If i'm right, then your stock fails because you can't pass id with such a stock.

As arkshine said, you could make a main native for this.

As all you said is quite abstract (dunno if this is the correct word), you should say more about what you exactly try to do.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-10-2010 , 18:53   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #16

Quote:
Originally Posted by ConnorMcLeod View Post
abstract (dunno if this is the correct word)
Yep.
__________________
fysiks is offline
Old 12-11-2010, 02:00
Exolent[jNr]
This message has been deleted by Exolent[jNr]. Reason: 2nd page broke.
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-11-2010 , 02:07   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #17

I tried to be as descriptive as possible but i will start over again:

Well, i m making a plugin in which there are around 20 natives, most of these natives only have the purpose of executing a specific function in the main plugin; see below for info:
Code:
// The native in the include file native do_something_cool( id )
Code behind this native in the main plugin:
Code:
public _do_something_cool( id ) {      // Execute the cool funciton      some_cool_function( id )      return 1; }
Now since 20 of these natives are responsible for executing such functions in the main plugin, i thought of making one native which will execute the function by just its name; see below for more info:
Code:
native execute_function_byname( const function_name[] , player_index )
The code behind this native:
Code:
public _execute_function_byname( const function_name[], player_index ) {     // Convert by-ref parameter     param_convert( 1 )     // We will use "" in the second parameter since we want to execute     // da function in our own plugin !     if ( callfunc_begin( function_name , "" ) )     {         callfunc_push_int( player_index )         callfunc_end ( )         return 1;     } }
Now through 1 native i will be able to execute a function and will remove those other 20 natives doing the same job
My question was that is there any other way of doing this instead of using callfunc_* ??
also if i were to change all the private and stock functions to public one's, it wont affect the functionaliy of the plugin ??
__________________

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 , 02:14   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #18

Quote:
Originally Posted by Exolent[jNr] View Post
Ahem.

Quote:
Originally Posted by abdul-rehman View Post
@Others: If i change some stock functions and some private functions to public ones, it wont affect any thing, right ?? Coz i need to be care ful in making this plugin
No it will work just fine. All it will change is that the public functions will be accessible through fake forwards and callfuncs.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-11-2010 , 02:52   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #19

Quote:
Originally Posted by Exolent[jNr] View Post
accessible through fake forwards
What are Fake Forwards ??
__________________

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 , 03:31   Re: Using another way of calling functions instead of callfunc_*
Reply With Quote #20

Quote:
Originally Posted by abdul-rehman View Post
What are Fake Forwards ??
If you didn't continue to ignore my link then you would know.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 02:50.


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