Raised This Month: $ Target: $400
 0% 

Help with callfunc


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 01-03-2007 , 23:00   Re: Help with callfunc
#1

Code:
callfunc_begin(ItemCommand[id][UserCurrentItem[id]],"RolePlay.amxx") callfunc_push_int(id) callfunc_end()
What function is this: ItemCommand[id][UserCurrentItem[id]]?
Also you don't need "RolePlay.amxx" on the end if your calling within your own plugin.

Code:
callfunc_begin("some_function") callfunc_push_int(id) callfunc_end() public some_function(id) {    // your code here }
Note that the function your pointing to needs to be declared public.

There is a better method for performance which is...
Code:
new FuncYourFunction public plugin_init() {    FuncYourFunction = get_func_id("your_function") } public some_function() {    callfunc_begin_i(FuncYourFunction)    callfunc_push_int(id)    callfunc_end() } public your_function(id) {    // some code }
The reason this is better on performance if you are going to call this quite often is that integers are faster at parsing than strings.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd

Last edited by Orangutanz; 01-03-2007 at 23:14.
Orangutanz is offline
Closed Thread



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:30.


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