Raised This Month: $ Target: $400
 0% 

How can I make a config for my plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ibanezez
SourceMod Donor
Join Date: Aug 2014
Location: Earth
Old 09-13-2014 , 17:01   How can I make a config for my plugin?
Reply With Quote #1

I was wondering how I can make a config for my plugin. I want to be able to edit the names/types/links of items in the menu.

PHP Code:
#include <sourcemod>
#pragma semicolon 1

public Plugin:MyInfo =
{
    
name "Donate",
    
author "The Doctor!",
    
description "Type !donate to open up a donate menu in-game",
    
version "1.1",
    
url "http://www.dcommunity.tk/"
}

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_donate"Command_Donate"Donate to the Community");
}

public 
Action:Command_Donate(clientargs)
{
    new 
Handle:menuhandle CreatePanel();
    
SetPanelTitlemenuhandle"Donate to the community" );
    
DrawPanelTextmenuhandle" \n" ); 
    
DrawPanelItemmenuhandle"Perks/Info" );
    
DrawPanelItemmenuhandle"Add The Doctor! (Owner)" );
    
DrawPanelItemmenuhandle"Add Stormageddon (Admin)" );
    
DrawPanelItemmenuhandle"Add Poop Mann (Admin)" );
    
SendPanelToClientmenuhandleclientMenuCallBackMENU_TIME_FOREVER );
    
CloseHandlemenuhandle );
}

public 
MenuCallBackHandle:menuhandleMenuAction:actionClientPosition )
{
    if(
action == MenuAction_Select)
    {
        switch( 
Position )
        {
            case 
1:
            {
                
ShowMOTDPanel(Client"Perks/Info""http://ibanezez12.site.nfoservers.com/images/vip2.png"MOTDPANEL_TYPE_URL);
            }
            case 
2:
            {
                
ShowMOTDPanel(Client"Add The Doctor! (Owner)""http://ibanezez12.site.nfoservers.com/images/vip2.png"MOTDPANEL_TYPE_URL);
            }
            case 
3:
            {
                
ShowMOTDPanel(Client"Add Stormageddon (Admin)""http://ibanezez12.site.nfoservers.com/images/vip2.png"MOTDPANEL_TYPE_URL);
            }
            case 
4:
            {
                
ShowMOTDPanel(Client"Add Poop Mann (Admin)""http://ibanezez12.site.nfoservers.com/images/vip2.png"MOTDPANEL_TYPE_URL);
            }
        }
    }

__________________
Hello

Last edited by Ibanezez; 09-13-2014 at 17:02.
Ibanezez is offline
floube
SourceMod Donor
Join Date: Jan 2013
Location: Austria
Old 09-13-2014 , 17:47   Re: How can I make a config for my plugin?
Reply With Quote #2

This pretty much.

More. Easy?
__________________
floube 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 01:50.


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