Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #pragma newdecls required
- #define NAME "Simple Menu"
- #define AUTHOR "Master"
- #define VERSION "1.0"
- #define URL "https://cswild.pl/"
- #define nullstr NULL_STRING
- bool wyswietlone_menu[MAXPLAYERS +1];
- public Plugin myinfo =
- {
- name = NAME,
- author = AUTHOR,
- version = VERSION,
- url = URL
- };
- public void OnPluginStart()
- {
- RegConsoleCmd("sm_help", CMD_Help);
- RegConsoleCmd("sm_pomoc", CMD_Help);
- HookEvent("player_spawn", OdrodzenieGracza, EventHookMode_Post);
- }
- public void OnClientDisconnect(int client)
- {
- wyswietlone_menu[client] = false;
- }
- public void OnClientAuthorized(int client)
- {
- wyswietlone_menu[client] = false;
- }
- public Action CMD_Help(int client, int args)
- {
- Menu menu = new Menu(Menu_Handler);
- menu.SetTitle("Wprowadzenie do gry\n \n");
- menu.AddItem(nullstr, "Najważniejsze rzeczy");
- menu.AddItem(nullstr, "System punktów i rang");
- menu.AddItem(nullstr, "Administracja");
- menu.AddItem(nullstr, "Odwiedź nasz Sklep! (klik)");
- menu.Display(client, 60);
- return Plugin_Handled;
- }
- public int Menu_Handler(Menu menu, MenuAction action, int client, int a)
- {
- switch(action)
- {
- case MenuAction_Select:
- {
- switch(a)
- {
- case 0: DrawPanel(client, "Na serwerze mamy:\nSystem obstawiania! Wystarczy, że wpiszesz bet drużyna ilość i obstawisz zwycięską drużynę! Pamiętaj, że musisz być martwy.\nSpadochron pod E\nSystem QuickDefuse(kabelki), użycie kiedy bombę i tak rozbroimy jest karane banem!\nAutorski Ranking\nMożesz wybrać własny HYMN MVM pod !mvp\nMożesz wymieniać się itemami ze sklepu z innymi graczami wpisując !trade :)\nPomiędzy rundami, możesz grać w Ping-Ponga!");
- case 1: DrawPanel(client, "Za każde zabójstwo przeciwnika dostajemy punkty w rankingu, postep możesz sprawdzić wpisując !rank\nRanga odświeża Ci się po każdej zmianie mapy, także nie panikuj jak przez jedną mapę masz ciągle taką samą :P");
- case 2:DrawPanel(client, "Właściciel:\n-->YuGi*\n\nAdministratorzy:\n-->ASzaz ^.^\n-->ADEK\n-->Sasuke\n-->oOoMACIEKoOo");
- case 3: FakeClientCommandEx(client, "sm_shop");
- }
- }
- case MenuAction_End:
- delete menu;
- }
- return 0;
- }
- public void DrawPanel(int client, const char[] buffer)
- {
- Panel panel = new Panel();
- panel.SetTitle("Wprowadzenie do gry");
- panel.DrawText("----------------------------------------------------------------------------------");
- panel.DrawText(buffer);
- panel.DrawText("----------------------------------------------------------------------------------");
- panel.DrawItem("Wróć");
- panel.DrawItem("Wyjdź");
- panel.Send(client, PanelHandler, 30);
- delete panel;
- }
- public int PanelHandler(Menu menu, MenuAction action, int client, int item)
- {
- switch(action)
- {
- case MenuAction_Select:
- {
- switch(item)
- {
- case 1: CMD_Help(client, 0);
- case 2: delete menu;
- }
- }
- }
- }
- public void OdrodzenieGracza(Event event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "userid"));
- if(!wyswietlone_menu[client])
- FakeClientCommandEx(client, "sm_pomoc");
- wyswietlone_menu[client] = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement