AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   callfunc from another plugin [menu] (https://forums.alliedmods.net/showthread.php?t=232811)

faki 01-05-2014 08:17

callfunc from another plugin [menu]
 
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

akcaliberg 01-05-2014 08:39

Re: callfunc from another plugin [menu]
 
you should push the second parameter (itemid) too.

faki 01-05-2014 08:40

Re: callfunc from another plugin [menu]
 
I know, but i dont know how..
Can you help me ?

akcaliberg 01-05-2014 13:13

Re: callfunc from another plugin [menu]
 
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


All times are GMT -4. The time now is 10:14.

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