Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include "W3SIncs/War3Source_Interface"
- public Plugin:myinfo =
- {
- name = "War3Source - Engine - Menu War3Menu",
- author = "War3Source Team",
- description = "Shows the war3menu"
- };
- public OnWar3Event(W3EVENT:event,client){
- if(event==DoShowWar3Menu){
- ShowWar3Menu(client);
- }
- }
- ShowWar3Menu(int client){
- Menu war3Menu= new Menu(War3Source_War3Menu_Select);
- war3menu.SetTile("Menu Test");
- int limit=9;
- chat transbuf[32];
- chat menustr[100];
- for(int i=0;i<=limit;i++)
- {
- Format(transbuf,sizeof(transbuf),"War3Menu_Item%d",i);
- Format(menustr,sizeof(menustr),"%T",transbuf,client);
- char numstr[4];
- Format(numstr,sizeof(numstr),"%d",i);
- war3menu.AddItem(numstr,menustr);
- }
- war3menu.Display(client,MENU_TIME_FOREVER);
- }
- public War3Source_War3Menu_Select(Menu menu, MenuAction action, int client,int selection)
- {
- if(action==MenuAction_Select)
- {
- char select[1024];
- GetMenuItem(menu, selection, select, sizeof(select));
- switch(selection)
- {
- case 0: // war3help
- {
- W3CreateEvent(DoShowHelpMenu,client);
- }
- case 1: // changerace
- {
- W3CreateEvent(DoShowChangeRaceMenu,client);
- }
- case 2: // skillsinfo
- {
- W3ShowSkillsInfo(client);
- }
- case 3: // raceinfo
- {
- W3CreateEvent(DoShowRaceinfoMenu,client);
- }
- case 4: // raceinfo
- {
- W3CreateEvent(DoShowPlayerinfoMenu,client);
- }
- case 5: // resetskills
- {
- W3CreateEvent(DoResetSkills,client);
- }
- case 6: // spendskills
- {
- W3CreateEvent(DoShowSpendskillsMenu,client);
- }
- case 7: // shopmenu
- {
- W3CreateEvent(DoShowShopMenu,client);
- }
- case 8: // itemsinfo
- {
- W3CreateEvent(DoShowItemsInfoMenu,client);
- }
- case 9:
- {
- W3CreateEvent(DoShowLevelBank,client);
- }
- }
- }
- if(action==MenuAction_End)
- {
- CloseHandle(menu);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement