Raised This Month: $ Target: $400
 0% 

[L4D2] Plugin to load another plugin. Possible?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WolfGang
BANNED
Join Date: Oct 2010
Old 09-21-2011 , 20:35   [L4D2] Plugin to load another plugin. Possible?
Reply With Quote #1

Im trying to use the "point system" and add a "Upgrade Menu" to the menu/list and when players clicked on the "Upgrade Menu" it would load them to my perkmod plugin. Possible?

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\

AddMenuItem(menu, "option1", "Health Menu");
}
if ( GetConVarInt(meleecat) > -1 )
{
AddMenuItem(menu, "option2", "Melee Menu");
}
if ( GetConVarInt(weaponscat) > -1 )
{
AddMenuItem(menu, "option3", "Weapons Menu");
}
if ( GetConVarInt(explosivescat) > -1 )
{
AddMenuItem(menu, "option4", "Explosives Menu");
}
if ( GetConVarInt(ammocat) > -1 )
{
AddMenuItem(menu, "option5", "Ammo Menu");
}
SetMenuExitButton(menu, true);
DisplayMenu(menu, clientId, MENU_TIME_FOREVER);

}

return Plugin_Handled;

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\

Sorry for my poor explaination
WolfGang is offline
WolfGang
BANNED
Join Date: Oct 2010
Old 09-24-2011 , 15:43   Re: [L4D2] Plugin to load another plugin. Possible?
Reply With Quote #2

Help Please!
WolfGang is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-24-2011 , 15:49   Re: [L4D2] Plugin to load another plugin. Possible?
Reply With Quote #3

Read this
http://wiki.alliedmods.net/Function_...d_Scripting%29
AtomicStryker is offline
WolfGang
BANNED
Join Date: Oct 2010
Old 09-24-2011 , 15:57   Re: [L4D2] Plugin to load another plugin. Possible?
Reply With Quote #4

Would you please do a mini sample for me please! It'll help alittle bit to understand.
WolfGang is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 09-24-2011 , 17:03   Re: [L4D2] Plugin to load another plugin. Possible?
Reply With Quote #5

In your Perk mod plugin:

PHP Code:
public CallPerkModMenu(clientnumberAnumberB)
{
.........

In your usepoints plugin

PHP Code:
        new Handle:iter GetPluginIterator();
        new 
Handle:pl;
        new Function:
func;
        while (
MorePlugins(iter))
        {
            
pl ReadPlugin(iter);
            
func=GetFunctionByName(pl,"CallPerkModMenu");
            if(
func!=INVALID_FUNCTION){
                
Call_StartFunction(pl,func);
                
                
//arguments in order here!!
                
Call_PushCell(client);
                
Call_PushCell(numberA);
                
Call_PushCell(numberB);                

                
Call_Finish(dummyreturn);
            }
        }
        
        
CloseHandle(iter); 
AtomicStryker is offline
WolfGang
BANNED
Join Date: Oct 2010
Old 09-24-2011 , 17:08   Re: [L4D2] Plugin to load another plugin. Possible?
Reply With Quote #6

Quote:
Originally Posted by AtomicStryker View Post
In your Perk mod plugin:

PHP Code:
public CallPerkModMenu(clientnumberAnumberB)
{
.........

In your usepoints plugin

PHP Code:
        new Handle:iter GetPluginIterator();
        new 
Handle:pl;
        new Function:
func;
        while (
MorePlugins(iter))
        {
            
pl ReadPlugin(iter);
            
func=GetFunctionByName(pl,"CallPerkModMenu");
            if(
func!=INVALID_FUNCTION){
                
Call_StartFunction(pl,func);
                
                
//arguments in order here!!
                
Call_PushCell(client);
                
Call_PushCell(numberA);
                
Call_PushCell(numberB);                

                
Call_Finish(dummyreturn);
            }
        }
        
        
CloseHandle(iter); 
I dont really get the perkmod example you posted . It would be nice enough if you do the whole thing for me.
WolfGang 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 03:49.


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