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

How to add a bot to an online server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tower02
New Member
Join Date: Jun 2022
Old 06-16-2022 , 17:42   How to add a bot to an online server
Reply With Quote #1

Hi guys,

I saw a bot playing like a real player on their online server. How is this possible? Can anyone help or share a plugin on this issue?
Tower02 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-16-2022 , 17:50   Re: How to add a bot to an online server
Reply With Quote #2

Quote:
Originally Posted by Tower02 View Post
Hi guys,

I saw a bot playing like a real player on their online server. How is this possible? Can anyone help or share a plugin on this issue?
It's not issue, they are joining the server by someone using an progrem, try this:

PHP Code:
#include <amxmodx>
 
#define PLUGIN "BanIP Fakes"
#define VERSION "0.2"
#define AUTHOR "Safety1st"
 
/*---------------EDIT ME------------------*/
#define MAX_SAME_IP        6   // رپذ؛ذ¾ذ»رŒذ؛ذ¾ ذ¸ذ³ر€ذ¾ذ؛ذ¾ذ² ذ¼ذ¾ذ¶ذµر‚ ذ·ذ°ر…ذ¾ذ´ذ¸ر‚رŒ رپ ذ¾ذ´ذ½ذ¾ذ³ذ¾ IP ذ°ذ´ر€ذµرپذ°
#define BAN_DURATION       120
new gszKickMsg[] =         "Fuck your family xD"
 
#define MAX_PLAYERS        32
//#define WHITELIST_SIZE   4   // EXACTLY as rows quantity below; uncomment to enable whitelist
 
#if defined WHITELIST_SIZE
 
new const gszWhiteList[WHITELIST_SIZE][] = {
    
"127.0.0.0/8",         // loopback interface (usually assigned IP is 127.0.0.1)
    
"192.168.0.0/24",      // 192.168.0.0/24 subnet, IPs range 192.168.0.0 ... 192.168.0.255
    
"10.3.3.2/24",         // 10.3.3.0/24 subnet, we could use any of its IPs here
    
"141.101.120.244"      // c-s.net.ua IP
}
#endif
/*----------------------------------------*/
 
#define DEBUG   // uncomment to enable some messages
 
new gszPlayerIP[MAX_PLAYERS 1][16]
new 
Trie:gtPlayerIPs
 
#if defined WHITELIST_SIZE
enum _:WhitelistData {
    
NET_IP,
    
NET_MASK

}
new Array:
gaWhitelist
#endif
 
#define FIRST_PLAYER   1
#define SINGLE_PLAYER  1
 
public plugin_init() 
{    
    
register_pluginPLUGINVERSIONAUTHOR )
    
// register_cvar( "banipfakes_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED )
    
    
gtPlayerIPs TrieCreate()
    
#if defined WHITELIST_SIZE
    
new iData[WhitelistData]
    
gaWhitelist ArrayCreate(WhitelistData)
    
    for( new 
iWHITELIST_SIZEi++ )
    {
        
net_to_longgszWhiteList[i], iData[NET_IP], iData[NET_MASK] )
        
ArrayPushArraygaWhitelistiData )
    }
#endif
}
        

 
 
public 
client_putinserver(id)
{
    new 
szPlayerIP[16]
    
get_user_ipidszPlayerIPcharsmax(szPlayerIP), /* without port */ )
    
#if defined WHITELIST_SIZE
    
new iData[WhitelistData]
    
    for( new 
iWHITELIST_SIZEi++ ) 
    {
        
ArrayGetArraygaWhitelistiiData )
        if( 
iData[NET_IP] == ip_to_long(szPlayerIP) & iData[NET_MASK] ) 
        {
            
#if defined DEBUG
            
server_print"White IP detected: id %d, IP %s"idszPlayerIP )
            
#endif
            
return
        }
    }
#endif
    
new iQuantity FIRST_PLAYER
    
if( TrieGetCellgtPlayerIPsszPlayerIPiQuantity ) )
    {
        if( ++
iQuantity MAX_SAME_IP )
        {
            
server_cmd"kick #%d  %s; wait; addip %d %s"get_user_userid(id), gszKickMsgBAN_DURATIONszPlayerIP )
            static 
szBanMsg[] = "IP %s has been banned for %d minutes"
            
log_to_file"banip-fakes.log",szBanMsgszPlayerIPBAN_DURATION )
            
//log_amx( szBanMsg, szPlayerIP, BAN_DURATION )
        
}
    }
    
TrieSetCellgtPlayerIPsszPlayerIPiQuantity )
    
copygszPlayerIP[id], charsmaxgszPlayerIP[] ), szPlayerIP )
}
        
        
 
public 
client_disconnected(id)
{
    if( !
gszPlayerIP[id][0] )
        
// whitelisted player or not fully initialized one (it could happen nearly a map change)
        
return
    
    new 
iQuantity
    TrieGetCell
gtPlayerIPsgszPlayerIP[id], iQuantity )
    if( 
iQuantity == SINGLE_PLAYER )
        
TrieDeleteKeygtPlayerIPsgszPlayerIP[id] )
    else
        
TrieSetCellgtPlayerIPsgszPlayerIP[id], --iQuantity )
    
    
gszPlayerIP[id][0] = EOS

}
 
/*-- Modified and simplified 'IP converter stocks' by Zetex --*/
 
// Gets net and mask as LONG from subnet.
stock net_to_longnet_string[], &net, &mask )
{
    new 
iip[16]
    
copycipcharsmax(ip), net_string'/' )
    
mask cidr_to_longnet_string[1] ) : 0xFFFFFFFF /* mask /32, IP itself */
    
net ip_to_long(ip) & mask
}
 
// Converts mask to LONG. Returns unsigned long.
stock cidr_to_longmask_string[] )
{
    new 
mask str_to_num(mask_string)
    new 
result = (<< 31) >> (mask 1)
    
    return 
result
}
 
// Converts IP to LONG. Returns unsigned long.
stock ip_to_longip_string[] )
{
    new 
right[16], part[4], octetip 0
    strtok
ip_stringpart3right15'.' )
    
    for( new 
04i++ ) 
    {
        
octet str_to_num(part)
        
ip += octet
        
        
if( == )
            break
            
        
strtokrightpart3right15'.' )
        
ip ip << 8
    
}
    return 
ip

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 06-17-2022 at 11:21.
Supremache is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 06-16-2022 , 18:38   Re: How to add a bot to an online server
Reply With Quote #3

That's bad advice Supremache
__________________
bigdaddy424 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-16-2022 , 19:30   Re: How to add a bot to an online server
Reply With Quote #4

Quote:
Originally Posted by bigdaddy424 View Post
That's bad advice Supremache
I was using it years ago but nowadays there are some useful modules for that
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-17-2022 , 19:41   Re: How to add a bot to an online server
Reply With Quote #5

Pod bots
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 19:16.


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