-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathberobot_restrictions.sp
55 lines (47 loc) · 1.27 KB
/
berobot_restrictions.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
46
47
48
49
50
51
52
53
54
55
#include <tf2>
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <sm_logger>
#include <morecolors>
#include <berobot_constants>
#include <berobot_core_restrictions>
#include <berobot>
char LOG_TAGS[][] = {"VERBOSE", "INFO", "ERROR"};
enum(<<= 1)
{
SML_VERBOSE = 1,
SML_INFO,
SML_ERROR,
}
#include <berobot_core>
#pragma newdecls required
#pragma semicolon 1
GlobalForward _restrictionChangedForward;
public Plugin myinfo =
{
name = "berobot_restrictions",
author = "icebear",
description = "",
version = "0.1",
url = "https://github.com/higps/robogithub"
};
public void OnPluginStart()
{
SMLoggerInit(LOG_TAGS, sizeof(LOG_TAGS), SML_ERROR, SML_FILE);
SMLogTag(SML_INFO, "berobot_restrictions started at %i", GetTime());
_restrictionChangedForward = new GlobalForward("MM_OnRestrictionChanged", ET_Ignore, Param_String);
}
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
CreateNative("OnRestrictionChanged", Native_OnRestrictionChanged);
return APLRes_Success;
}
public any Native_OnRestrictionChanged(Handle plugin, int numParams)
{
char name[NAMELENGTH];
GetNativeString(1, name, NAMELENGTH);
Call_StartForward(_restrictionChangedForward);
Call_PushString(name);
Call_Finish();
}