AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Detect [NO-sXe-I] plugin (https://forums.alliedmods.net/showthread.php?t=65587)

alexinno 01-12-2008 03:20

Detect [NO-sXe-I] plugin
 
Hi!
I would like if it's possible to have a plugin that detects players without sxe-injected , so i put sxe in optional mod , and if a player doesn't have the anticheat installed and active he's nick will be tag-ed with [NO-sXe-I].

The plugin should detect players with [NO-sXe-I] at every round start and punish them with 25 hp (this value should be configurable)

Here is SAMURAI's try but no effect on players

Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "No SXe Detect"
#define VERSION "1.0"
#define AUTHOR "SAMURAI"

new cvar_rmv_health;

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
   
    register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
   
    cvar_rmv_health = register_cvar("health_penalty","10");
}

public event_new_round()
{
    static players[32], name[32], inum, i, id;
    get_players(players,inum);
    for(i = 0; i< inum;i++)
    {
        id = players[i];
        get_user_name(id,name,31);
       
        if(is_user_alive(id) && containi(name,"[NO-sXe-I]") !=-1 )
        {
            set_user_health(id,get_user_health(id) - get_pcvar_num(cvar_rmv_health));
            client_print(id,print_chat,"Ti s-a scazut %d din viata pentru ca nu ai sXe Inejected activat !",get_pcvar_num(cvar_rmv_health));
       
        }
    }
}

thx in advance

ConnorMcLeod 01-12-2008 04:46

Re: Detect [NO-sXe-I] plugin
 
PHP Code:

#include <amxmodx>

#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])
        
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



alexinno 01-12-2008 05:11

Re: Detect [NO-sXe-I] plugin
 
Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/phpyW8ajW.sma(42) : error 017: undefined symbol "no_sxe_hp_punish"
/home/groups/amxmodx/tmp3/phpyW8ajW.sma(49) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/phpyW8ajW.sma(50) : warning 204: symbol is assigned a value that is never used: "g_pcvarHpPunish"

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpyW8ajW.amx (compile failed).

ConnorMcLeod 01-12-2008 05:23

Re: Detect [NO-sXe-I] plugin
 
Oups :oops:
Fixed :mrgreen:

alexinno 01-12-2008 08:12

Re: Detect [NO-sXe-I] plugin
 
thx :P

sett1ng 05-20-2020 01:45

Re: Detect [NO-sXe-I] plugin
 
[QUOTE=ConnorMcLeod;573165][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

alferd 05-20-2020 03:59

Re: Detect [NO-sXe-I] plugin
 
It is possible to automatically kick someone who does not have Sxe?

instinctpt1 05-21-2020 13:42

Re: Detect [NO-sXe-I] plugin
 
[QUOTE=sett1ng;2701170]
Quote:

Originally Posted by ConnorMcLeod (Post 573165)
[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 05-21-2020 13:48

Re: Detect [NO-sXe-I] plugin
 
Quote:

Originally Posted by alferd (Post 2701178)
It is possible to automatically kick someone who does not have Sxe?

Well i dont know about SXE but from the logic connor provided above, i modified it ; try
PHP Code:

#include <amxmodx>

public plugin_init() {
    
register_plugin("Detect No sXe players""0.1""connorr")
}

public 
client_putinserver(id) {
    static 
szName[32];get_user_name(idszNamecharsmax(szName));
    if(
containi(szName"[NO-sXe-I]") != -)
        
server_cmd("kick #%d ^"NO SXE NOT Allowed^""get_user_userid(id))



tarsisd2 05-21-2020 14:39

Re: Detect [NO-sXe-I] plugin
 
Quote:

Originally Posted by alferd (Post 2701178)
It is possible to automatically kick someone who does not have Sxe?

if the player dont have sxe and is not set as optional, then the sxe will kick the player it self, dont need a plugin for that


All times are GMT -4. The time now is 08:08.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.