Raised This Month: $ Target: $400
 0% 

CallFunc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 09-11-2005 , 03:54   CallFunc
Reply With Quote #1

Here's something I've been wondering. How is it possible to target something in another plugin with more than 1 thing needed.

like in HArbuRPAlpha.amxx
There is a code like
Code:
stock set_item_amount(id,func[],itemid,amount,table[],customid[]="")
Obviously it needs id, func, itemid, amount, table, customid.
Ok, How do I make it in callfunc, so that it targets all of these values needed from my plugin?

Here is my failed attempt.
Help?

Code:
callfunc_begin("set_item_amount","HarbuRPAlpha.amxx") callfunc_push_int(id,"+",411,1,"money") callfunc_end()


Ty.
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 09-11-2005 , 05:02  
Reply With Quote #2

Code:
callfunc_begin("set_item_amount","HarbuRPAlpha.amxx") callfunc_push_int( id ) callfunc_push_str( "+" ) callfunc_push_int( 411 ) callfunc_push_int( 1 ) callfunc_push_str( "money" ) callfunc_end()

this would be the right one.
but you want to call a stock, and you can't call a stock outside of the plugin.
If you want to call a function in a plugin then the function has to be marked as "public"
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 09-11-2005 , 05:17  
Reply With Quote #3

Or better yet try out the register_native feature.
Johnny got his gun is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 09-11-2005 , 09:01  
Reply With Quote #4

register_native is only usefull if you want to call a function that is declared in ONE plugin. But with callfunc you can call the same function in each plugin.
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 09-12-2005 , 01:09  
Reply With Quote #5

I just made a new script inside the HArbuRPAlpha

Code:
public gitems(id,itemid) {           set_item_amount(id,"+",itemid,1,"money")           return PLUGIN_HANDLED }

Thank you very much for your help on that
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-12-2005 , 03:48  
Reply With Quote #6

Quote:
Originally Posted by Greenberet
register_native is only usefull if you want to call a function that is declared in ONE plugin. But with callfunc you can call the same function in each plugin.
only if u made sense.........
Freecode is offline
BAILOPAN
Join Date: Jan 2004
Old 09-12-2005 , 03:51  
Reply With Quote #7

Quote:
Originally Posted by Freecode
Quote:
Originally Posted by Greenberet
register_native is only usefull if you want to call a function that is declared in ONE plugin. But with callfunc you can call the same function in each plugin.
only if u made sense.........
their purposes are different. you use register_native to let many plugins call your own function. however, you use callfunc to call many functions from your plugin.
__________________
egg
BAILOPAN is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-12-2005 , 03:53  
Reply With Quote #8

thats better
Freecode is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 09-12-2005 , 09:51  
Reply With Quote #9

So, basically register_native is the opposite command of callfunc then, correct?
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
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 14:32.


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