forked from bklol/Misc-Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kid-cpmenu.sp
45 lines (36 loc) · 919 Bytes
/
kid-cpmenu.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <sourcemod>
#include <shavit>
public void Shavit_OnStyleChanged(int client, int oldstyle, int newstyle)
{
DataPack styledata = new DataPack();
styledata.WriteCell(client);
styledata.WriteCell(oldstyle);
styledata.WriteCell(newstyle);
RequestFrame(PostStyleChanged, styledata);
}
public void PostStyleChanged(DataPack styledata)
{
styledata.Reset();
int client = styledata.ReadCell();
int oldstyle = styledata.ReadCell();
int newstyle = styledata.ReadCell();
if(newstyle == 4)
{
CloseClientMenu(client);
Shavit_RestartTimer(client, Track_Main);
}
CloseHandle(styledata);
}
stock int CloseClientMenu(client)
{
Menu ClearMenu = new Menu(MenuHandler_CloseClientMenu);
ClearMenu.SetTitle("Clearing Menu");
ClearMenu.Display(client, 1);
}
public int MenuHandler_CloseClientMenu(Menu menu, MenuAction action, int param1, int param2)
{
if(action == MenuAction_End)
{
delete menu;
}
}