Raised This Month: $51 Target: $400
 12% 

KnifeBot Detector


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
MadotsukiTeam
Junior Member
Join Date: Oct 2016
Old 01-09-2017 , 21:36   KnifeBot Detector
Reply With Quote #1

KnifeBot Detector
Author: Mistrick
Version: 0.9.8 (11.01.2017)

Description: KnifeBot detection. (All KnifeBot's)

Settings: Writes logs to the addons\amxmodx\logs\knifebot_detector.log


Code:
#define INIT_RECHECK 0.5
#define CHECK_TIME 0.15
#define RECHECK_TIME 3.0 // Recheck time
#define MAX_WARNIGNS 3
#define BOT_RECREATE  5

new const DEFAULT_NAME[] = ""; U must set it(like random symbols or nickname(ex. iajsdiajsd, Player-Cs16)

#define CHANGE_BOT_TEAM // Change bot team to opposite 
#define RANDOM_ANGLES // Random angels for bot spawn

Credits:
p3tsin - bot create
shel - detect idea
s1lent - help with engine
Attached Files
File Type: sma Get Plugin or Get Source (knifebot_detector.sma - 1370 views - 8.2 KB)

Last edited by MadotsukiTeam; 01-10-2017 at 16:12.
MadotsukiTeam is offline
MadotsukiTeam
Junior Member
Join Date: Oct 2016
Old 01-10-2017 , 16:13   Re: KnifeBot Detector
Reply With Quote #2

Upd 0/9/8
MadotsukiTeam is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-17-2017 , 10:33   Re: KnifeBot Detector
Reply With Quote #3

1. You're creating loads of tasks with the "id" index.
2. In client_putinserver , static isn't needed.
3. In CreateBot, what's this ? Shouldn't it be if(DEFAULT_NAME[0]) instead?
PHP Code:
    if(!DEFAULT_NAME[0])
    {
        
set_fail_state("Set own valid bot name!");

4. ML Support ?

5.
PHP Code:
#if defined CHANGE_BOT_TEAM
    
switch(cs_get_user_team(id))
    {
        case 
CS_TEAM_Tcs_set_user_team(g_BotIndexCS_TEAM_CTCS_CT_GIGN);
        case 
CS_TEAM_CTcs_set_user_team(g_BotIndexCS_TEAM_TCS_T_TERROR);
    }
    
#endif // CHANGE_BOT_TEAM
    

-->

PHP Code:
#if defined CHANGE_BOT_TEAM

    
new CsTeams:team cs_get_user_team(id)

    switch(
team)
    {
        case 
CS_TEAM_Tcs_set_user_team(g_BotIndexCS_TEAM_CTCS_CT_GIGN);
        case 
CS_TEAM_CTcs_set_user_team(g_BotIndexCS_TEAM_TCS_T_TERROR);
    }
    
#endif // CHANGE_BOT_TEAM 
6. #pragma semicolon isn't needed

7. You could add useful cvars such as for :
- set_pev(g_BotIndex, pev_health, 100.0);
- get_entity_distance(id, player) < 80)
- etc..

By the way you're not the author. Did you tell him about this? What have you changed?
__________________

Last edited by edon1337; 01-17-2017 at 10:35.
edon1337 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-17-2017 , 13:11   Re: KnifeBot Detector
Reply With Quote #4

Oh yea, I like it.

3. Its correct
5. It makes no sense.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-17-2017 at 13:12.
EFFx is offline
Mistrick
Senior Member
Join Date: Aug 2012
Location: Russia
Old 01-17-2017 , 14:55   Re: KnifeBot Detector
Reply With Quote #5

edon1337,
1. One task for one player. What problem?
2. How are you can count all players connections without saving number in variable? I don't need one more global variable.
3. Stop plugin if string is empty. My code is right.
4. ML for what? Plugin has only one message in chat.
5. Already answered.
6. My code style.
7. Useless for plugin user.
Mistrick is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-17-2017 , 15:58   Re: KnifeBot Detector
Reply With Quote #6

1. 32 tasks vs one in which you get all players. What do you think?
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-17-2017 , 17:38   Re: KnifeBot Detector
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
Oh yea, I like it.

3. Its correct
5. It makes no sense.
5. How does it make no sense ? Check other threads anyways.

@mistrick
1. Just like HamletEagle said. One task for each player, it will get messed up.
2. Do you think every single second a new player will join the server ? Have some logic. There's no need for a global variable just switch to new.
3. But, new const DEFAULT_NAME[] = ""; is an empty string, and you're checking
PHP Code:
if(!DEFAULT_NAME[0])
    {
        
set_fail_state("Set own valid bot name!");
    } 
"if not default name empty, set failed" , that makes no sense. So if someone changes the DEFAULT_NAME string it will throw fail state. You said it checks if string is empty, but ! means not so it checks if string isn't empty.
4. Then ? Easier for you to add ML system.
5. Already answered ;)
6. And what if a newbie accidentally removes a semicolon, so logical of you.
7. How's it 'useless' ?
__________________
edon1337 is offline
Mistrick
Senior Member
Join Date: Aug 2012
Location: Russia
Old 01-17-2017 , 20:23   Re: KnifeBot Detector
Reply With Quote #8

edon1337,
2. I count players connection on server. With new variable will be always 0.
3. You don't understand what I want. String empty by default, user should write own name. After this plugin will work.
4. ML useless for this plugin. If you need you can change one string by your self.
5. Where is difference?
PHP Code:
#include <amxmodx>

public plugin_init()
{
    new 
id;
    new 
team get_user_team(id);
    
    switch(
team)
    {
        case 
1team 1;
        case 
2team 2;
    }

    switch(
get_user_team(id))
    {
        case 
1team 1;
        case 
2team 2;
    }

PHP Code:
0x8         PROC                        plugin_init
 0xC         
BREAK     
 
0x10        BREAK     
 
0x14        PUSH.C                  0x0
 0x1C        
BREAK     
 
0x20        STACK                  -0x4
 0x28        PUSH
.C                  0x0
 0x30        ZERO
.pri  
 0x34        HEAP                    0x4
 0x3C        MOVS                    0x4
 0x44        PUSH
.alt  
 0x48        PUSH
.S                 -0x4
 0x50        PUSH
.C                  0xC
 0x58        SYSREQ
.C      get_user_team
 0x60        STACK                  0x10
 0x68        HEAP                   
-0x4
 0x70        STOR
.S.pri             -0x8
 0x78        
BREAK     
 
0x7C        LOAD.S.pri             -0x8
 0x84        
SWITCH            switch_00
 0x8C        
BREAK      ; target:case_00_00
 0x90        
CONST.pri               0x1
 0x98        STOR
.S.pri             -0x8
 0xA0        JUMP              jump_0000
 0xA8        
BREAK      ; target:case_00_01
 0xAC        
CONST.pri               0x2
 0xB4        STOR
.S.pri             -0x8
 0xBC        JUMP              jump_0000
 0xC4        CASETBL                 0x2        jump_0000 
target:switch_00
             
CASE                    0x1       case_00_00
             
CASE                    0x2       case_00_01
 0xE0        
BREAK      ; target:jump_0000
 0xE4        PUSH
.C                  0x0
 0xEC        ZERO
.pri  
 0xF0        HEAP                    0x4
 0xF8        MOVS                    0x4
 0x100       PUSH
.alt  
 0x104       PUSH
.S                 -0x4
 0x10C       PUSH
.C                  0xC
 0x114       SYSREQ
.C      get_user_team
 0x11C       STACK                  0x10
 0x124       HEAP                   
-0x4
 0x12C       
SWITCH            switch_01
 0x134       
BREAK      ; target:case_01_00
 0x138       
CONST.pri               0x1
 0x140       STOR
.S.pri             -0x8
 0x148       JUMP              jump_0002
 0x150       
BREAK      ; target:case_01_01
 0x154       
CONST.pri               0x2
 0x15C       STOR
.S.pri             -0x8
 0x164       JUMP              jump_0002
 0x16C       CASETBL                 0x2        jump_0002 
target:switch_01
             
CASE                    0x1       case_01_00
             
CASE                    0x2       case_01_01
 0x188       STACK                   0x8 
target:jump_0002
 0x190       ZERO
.pri  
 0x194       RETN 
Create variable on stack in first example for new team and create variable on stack in second example for temporal variable. Optimization in 1-2 asm instructions? For what I need care about create useless variable if compiler does it for me?
6. We are write plugins for babies? I think they can use search.
7. No one plugin user doesn't need change this values. Magic numbers only for me.

Code with tasks maybe will rewrite.
Mistrick is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-18-2017 , 02:28   Re: KnifeBot Detector
Reply With Quote #9

5.Doesn't matter.
3.It checks if strings is empty.
6.Good for them, pragma is fine.
__________________

Last edited by HamletEagle; 01-18-2017 at 02:28.
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-18-2017 , 14:25   Re: KnifeBot Detector
Reply With Quote #10

Why pragma is fine? It changes any thing?
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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