-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.sp
43 lines (34 loc) · 1.19 KB
/
example.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
#include <jumpqol.inc>
#include <tf2.inc>
public void OnPluginStart()
{
int count = Jumpqol_GetSettingCount();
for (int setting = 0; setting < count; setting++) {
char name[64];
Jumpqol_GetSettingName(setting, name, 64);
PrintToServer("setting: %s", name);
}
HookEvent("player_death", OnClientDeath);
}
public SettingAllow Jumpqol_OnSettingChange(const char[] setting, int client, SettingType type, any value_old, any value_new)
{
PrintToServer("setting about to change: %s", setting);
if (StrEqual(setting, "sync") && view_as<TFTeam>(GetClientTeam(client)) != TFTeam_Blue) {
ReplyToCommand(client, "need to be on blu team to change your sync setting");
return JUMPQOL_BLOCK;
}
if (StrEqual(setting, "fakedelay")) {
ReplyToCommand(client, "respawn for fakedely to apply");
return JUMPQOL_STORE;
}
return JUMPQOL_ALLOW;
}
void OnClientDeath(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
Jumpqol_ApplyPreferredValue("fakedelay", client);
}
public void Jumpqol_OnSettingChanged(const char[] setting, int client, SettingType type, any value_old, any value_new)
{
PrintToServer("setting changed: %s", setting);
}