Promouvoir serveur

Bots are no longer counted or kicked #2

Merged Daemon666 merged 1 commits from daemon-patch-1 into main
1 changed file with 5 additions and 3 deletions
+5 -3 addons/amxmodx/scripting/csb_fakeplayer_guard.sma M
@@ -46,7 +46,8 @@ public client_connect(id)
46 46 g_bInGame[id] = false
47 47 get_user_ip(id, g_szIp[id], charsmax(g_szIp[]), 1)
48 48
49 - if (!get_pcvar_num(g_pEnabled))
49 + // bots share the server's own address and never send input: leave them alone
50 + if (!get_pcvar_num(g_pEnabled) || is_user_bot(id))
50 51 return
51 52
52 53 // concurrent connections from the same address
@@ -104,7 +105,7 @@ countIp(const ip[], exclude)
104 105 {
105 106 new pid = players[i]
106 107
107 - if (pid == exclude)
108 + if (pid == exclude || is_user_bot(pid))
108 109 continue
109 110
110 111 new pip[24]
@@ -119,6 +120,7 @@ countIp(const ip[], exclude)
119 120
120 121 dropClient(id, const reason[])
121 122 {
123 + // queued, not run here: kicking a client in the middle of its own
124 + // connect can take the whole server down
122 125 server_cmd("kick #%d ^"CSB Fake Guard: %s^"", get_user_userid(id), reason)
123 - server_exec()
124 126 }
125 127