Raised This Month: $ Target: $400
 0% 

callfunc from another plugin [menu]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
faki
Senior Member
Join Date: Jul 2013
Old 01-05-2014 , 08:17   callfunc from another plugin [menu]
Reply With Quote #1

I have this from second plugin:
Code:
public shop_item_selected(id,itemid)
{
        if(itemid != item_id12) return PLUGIN_HANDLED
	give_item(id, "weapon_ak47")
	g_HasAk[id] = true
	
	ColorChat(id,GREEN, "[VZBB]^x01 You have bought a^x04 Golden Ak47^x01!")
	
	return PLUGIN_HANDLED
}
Here is my code:
Code:
public MenuHandler( id , menu , item )
{
	if( item == MENU_EXIT )
	{
		return PLUGIN_HANDLED;
	}



switch( item )
{
case 1: somelocal(id)
//case 2: givehp(id)
//case 3: respawn(id)
}
	return PLUGIN_HANDLED
}

public somelocal(id)
{
    if(callfunc_begin("shop_item_selected", "golden_ak.amxx") == 1)
    {
        callfunc_push_int(id)

        callfunc_end()
    }  
}
I need to give golden ak47 when choose the item from menu
faki is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 01-05-2014 , 08:39   Re: callfunc from another plugin [menu]
Reply With Quote #2

you should push the second parameter (itemid) too.
akcaliberg is offline
faki
Senior Member
Join Date: Jul 2013
Old 01-05-2014 , 08:40   Re: callfunc from another plugin [menu]
Reply With Quote #3

I know, but i dont know how..
Can you help me ?
faki is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 01-05-2014 , 13:13   Re: callfunc from another plugin [menu]
Reply With Quote #4

First, you should find the item_id12 's numeric equivalent.

Then add callfunc_push_int(numeric equivalent of item_id12) after the callfunc_push_int(id)

I can't say anything more without golden_ak.sma
akcaliberg 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 10:14.


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