[QUOTE=sett1ng;2701170]
Quote:
Originally Posted by ConnorMcLeod
[php]#include <amxmodx>
Do you have any idea how I can edit this so that "[NO-sXe-I]" does not appear to the administrators of the server that do not enter with sxe? I have administrators who are steam and the injected sxe does not work for them
|
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define MAX_PLAYERS 32
new bool:g_bRestartAttempt[MAX_PLAYERS+1]
new bool:g_bNoSxe[MAX_PLAYERS+1]
new g_pcvarHpPunish
public plugin_init() {
register_plugin("Detect No sXe players", "0.1", "connorr")
g_pcvarHpPunish = register_cvar("no_sxe_hp_punish", "25")
register_event("TextMsg", "eRestartAttempt", "a", "2=#Game_will_restart_in")
register_event("ResetHUD", "eResetHUD", "be")
register_clcmd("fullupdate", "fullupdateCmd")
}
public fullupdateCmd() {
return PLUGIN_HANDLED_MAIN
}
public eRestartAttempt() {
new players[MAX_PLAYERS], num
get_players(players, num, "a")
for (new i; i < num; ++i)
g_bRestartAttempt[players[i]] = true
}
public eResetHUD(id) {
if (g_bRestartAttempt[id]) {
g_bRestartAttempt[id] = false
return
}
event_player_spawn(id)
}
public event_player_spawn(id) {
if(g_bNoSxe[id])
if(!is_user_admin(id))
user_slap(id, get_pcvar_num(g_pcvarHpPunish), 0)
}
public client_putinserver(id) {
static szName[32];get_user_name(id, szName, 31)
static const szNoSxe[] = "[NO-sXe-I]"
g_bNoSxe[id] = containi(szName, szNoSxe) != -1 ? true : false
}
I have added exceptions for admins, now they won't get punished