View Single Post
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-21-2020 , 13:42   Re: Detect [NO-sXe-I] plugin
Reply With Quote #8

[QUOTE=sett1ng;2701170]
Quote:
Originally Posted by ConnorMcLeod View Post
[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
(playersnum"a")
    for (new 
inum; ++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(idget_pcvar_num(g_pcvarHpPunish), 0)
}

public 
client_putinserver(id) {
    static 
szName[32];get_user_name(idszName31)
    static const 
szNoSxe[] = "[NO-sXe-I]"
    
g_bNoSxe[id] = containi(szNameszNoSxe) != -true false

I have added exceptions for admins, now they won't get punished
instinctpt1 is offline