-
Notifications
You must be signed in to change notification settings - Fork 5
/
autoBan.php
66 lines (62 loc) · 2.62 KB
/
autoBan.php
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
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
* Plugin Name: autoBan
* Version: 0.0.1
* Details: Automatically ban users at or below 0 trust score.
* Created Date: Monday, November 9th 2018, 2:32:13 am
* Author: Avery Johnson
*
* Copyright (c) 2018 Avery Johnson
*/
class autoBan
{
public static function playerWarned($name, $license, $reason)
{
error_log('Player Warned: ' . trustScore($license));
if(trustScore($license) < 0) {
dbquery('INSERT INTO bans (name, identifier, reason, ban_issued, banned_until, staff_name, staff_steamid) VALUES (
"' . escapestring($name) . '",
"' . escapestring($license) . '",
"Trust Score Below 0%",
"' . time() . '",
"0",
"' . escapestring(siteConfig('community_name')) . ' - Automatic Ban",
"Unknown"
)', false);
removeFromSession($license, "Turst Score Below 0%");
sendMessage('^3' . $name . '^0 has been permanently banned by ^2' . siteConfig('community_name') . ' - Automatic Ban ^0 for ^Trust Score Below 0%');
}
}
public static function playerKicked($name, $license, $reason)
{
error_log('Player Kicked: ' . trustScore($license));
if(trustScore($license) < 0) {
dbquery('INSERT INTO bans (name, identifier, reason, ban_issued, banned_until, staff_name, staff_steamid) VALUES (
"' . escapestring($name) . '",
"' . escapestring($license) . '",
"Trust Score Below 0%",
"' . time() . '",
"0",
"' . escapestring(siteConfig('community_name')) . ' - Automatic Ban",
"Unknown"
)', false);
sendMessage('^3' . $name . '^0 has been permanently banned by ^2' . siteConfig('community_name') . ' - Automatic Ban ^0 for ^Trust Score Below 0%');
}
}
public static function playerBanned($name, $license, $reason, $length, $staff)
{
error_log('Player Banned: ' . trustScore($license));
if(trustScore($license) < 0 && $length != 0) {
dbquery('INSERT INTO bans (name, identifier, reason, ban_issued, banned_until, staff_name, staff_steamid) VALUES (
"' . escapestring($name) . '",
"' . escapestring($license) . '",
"Trust Score Below 0%",
"' . time() . '",
"0",
"' . escapestring(siteConfig('community_name')) . ' - Automatic Ban",
"Unknown"
)', false);
sendMessage('^3' . $name . '^0 has been permanently banned by ^2' . siteConfig('community_name') . ' - Automatic Ban ^0 for ^Trust Score Below 0%');
}
}
}