Raised This Month: $32 Target: $400
 8% 

Create Menu from config file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HyperX
Junior Member
Join Date: Sep 2017
Old 10-30-2018 , 12:58   Create Menu from config file
Reply With Quote #1

I need a plugin which makes first line of config file first option of menu (menu.AddItem), Second line of config second option of menu

Can someone help me?
Thanks in advance

Game:CSGO (if required)
HyperX is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 10-30-2018 , 14:10   Re: Create Menu from config file
Reply With Quote #2

This opens the file everytime the command is written.
Optimal way would be to store the data inside an array on map start but either way this should work:

Spoiler
__________________

Last edited by Rohanlogs; 10-30-2018 at 14:17.
Rohanlogs is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 10-30-2018 , 23:41   Re: Create Menu from config file
Reply With Quote #3

https://forums.alliedmods.net/showthread.php?p=637467
HvG Community is offline
HyperX
Junior Member
Join Date: Sep 2017
Old 10-31-2018 , 03:43   Re: Create Menu from config file
Reply With Quote #4

Quote:
Originally Posted by HyperX View Post
I need a plugin which makes first line of config file first option of menu (menu.AddItem), Second line of config second option of menu

Can someone help me?
Thanks in advance

Game:CSGO (if required)
Working perfectly Thanks a Lot!
Can you add another thing:
PHP Code:
"Date"               "31/10/2018"
option 1 
option 2 
etc
"Date"              "1/11/2018"
option 1 
option 2 
etc 

Last edited by HyperX; 10-31-2018 at 03:43. Reason: forgot to add a thing
HyperX is offline
HyperX
Junior Member
Join Date: Sep 2017
Old 10-31-2018 , 03:44   Re: Create Menu from config file
Reply With Quote #5

Quote:
Originally Posted by HvG Community View Post
Thanks, using this too!
HyperX is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 11-04-2018 , 16:04   Re: Create Menu from config file
Reply With Quote #6

By the OP's detailed request via private message I made a better version of this.

It will read the menu items from /addons/sourcemod/configs/menudata.ini.
Here's what it should look like:
Code:
"Menu"
{
	"Additem 1"
	{
		"value" 	"Text item1"	
	}
	"Additem 2"
	{
		"value" 	"Text item2"	
	}
	"Additem 3"
	{
		"value" 	"Text item3..."	
	}
}
I've added this example config as an attachment.

EDIT:
There's also an admin command to refresh the config (sm_refresh_menudata).
Attached Files
File Type: ini menudata.ini (256 Bytes, 78 views)
File Type: sp Get Plugin or Get Source (sm_menu_config.sp - 268 views - 3.0 KB)
__________________

Last edited by Rohanlogs; 11-04-2018 at 16:06.
Rohanlogs is offline
alexr153
AlliedModders Donor
Join Date: Jul 2015
Location: In a house
Old 11-04-2018 , 18:31   Re: Create Menu from config file
Reply With Quote #7

You can try mine I made.
alexr153 is offline
HyperX
Junior Member
Join Date: Sep 2017
Old 11-07-2018 , 23:46   Re: Create Menu from config file
Reply With Quote #8

Quote:
Originally Posted by Rohanlogs View Post
By the OP's detailed request via private message I made a better version of this.

It will read the menu items from /addons/sourcemod/configs/menudata.ini.
Here's what it should look like:
Code:
"Menu"
{
	"Additem 1"
	{
		"value" 	"Text item1"	
	}
	"Additem 2"
	{
		"value" 	"Text item2"	
	}
	"Additem 3"
	{
		"value" 	"Text item3..."	
	}
}
I've added this example config as an attachment.

EDIT:
There's also an admin command to refresh the config (sm_refresh_menudata).
Thank you!!
HyperX 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 14:46.


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