Raised This Month: $32 Target: $400
 8% 

[Request] Spectbots Erorr


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 09-10-2019 , 12:27   [Request] Spectbots Erorr
Reply With Quote #1

Please Fix this problem
Proof: https://i.ibb.co/BgBzTSM/Untitled.png

PHP Code:
#pragma semicolon 1
#pragma ctrlchar '\'

new Plugin[11] =
{
    
9080545083112101991161150
}
new 
Version[6] =
{
    
50465646490
}
new 
Author[17] =
{
    
831111049710598881161141011091014678101840
}
new 
bool:is_user_ffbot[33];
new 
bool:checkingStatus;
new 
bool:changingBots;
new 
botCount;
new 
namesread;
new 
namesToUse[256][33];
new 
pDelay;
new 
pAuto;
new 
pPlayers;

Float:operator*(Float:,_:)(Float:oper1oper2)
{
    return 
oper1 float(oper2);
}

bool:operator<=(Float:,Float:)(Float:oper1Float:oper2)
{
    return 
>= floatcmp(oper1oper2);
}


cmd_access(idlevelcidnumbool:accesssilent)
{
    !!! 
Removed Phi
    
new has_access 0;
    new 
var1;
    if (
is_dedicated_server())
    {
        
var1 0;
    }
    else
    {
        
var1 1;
    }
    if (
var1 == id)
    {
        
has_access 1;
    }
    else
    {
        if (
level == 16777216)
        {
            if (
is_user_admin(id))
            {
                
has_access 1;
            }
        }
        if (
level get_user_flags(id0))
        {
            
has_access 1;
        }
        if (
level)
        {
        }
        else
        {
            
has_access 1;
        }
    }
    if (
has_access)
    {
        if (
num read_argc())
        {
            new 
hcmd[32];
            new 
hinfo[128];
            new 
hflag 0;
            
get_concmd(cidhcmd31hflaghinfo127level, -1);
            
console_print(id"%L:  %s %s"id"USAGE"hcmdhinfo);
            return 
0;
        }
        return 
1;
    }
    if (!
accesssilent)
    {
        
console_print(id"%L"id"NO_ACC_COM");
    }
    return 
0;
}


get_configsdir(String:name[], len)
{
    return 
get_localinfo("amxx_configsdir"namelen);
}

public 
plugin_init()
{
    
register_plugin("SpecBots""2.8.1""OhMyWay");
    
pAuto register_cvar("ff_automode""0"00.000);
    
pPlayers register_cvar("ff_players""2"00.000);
    
pDelay register_cvar("ff_delay""1"00.000);
    
register_concmd("amx_addfake""botadd"8"<# | @FILL> - add this many bots", -1);
    
register_concmd("amx_removefake""botremove"8"<# | @ALL> - remove this many bots", -1);
    
set_task(10.000"ServerStatus"0""0"b"0);
    
ReadNames();
    new 
cvarString[256];
    new 
shortName[16];
    
copy(shortName15"ff");
    
register_cvar("jtp10181"""680.000);
    
get_cvar_string("jtp10181"cvarString255);
    if (
strlen(cvarString))
    {
        if (
contain(cvarStringshortName) == -1)
        {
            
format(cvarString255"%s,%s"cvarStringshortName);
            
set_cvar_string("jtp10181"cvarString);
        }
    }
    else
    {
        
formatex(cvarString255shortName);
        
set_cvar_string("jtp10181"cvarString);
    }
    return 
0;
}

public 
plugin_natives()
{
    
set_module_filter("module_filter");
    
set_native_filter("native_filter");
    return 
0;
}

public 
module_filter(String:module[])
{
    !!! 
Removed Phi
    
if (!cstrike_running() && equali(module"cstrike"0))
    {
        return 
1;
    }
    return 
0;
}

public 
native_filter(String:name[], indextrap)
{
    if (!
trap)
    {
        return 
1;
    }
    return 
0;
}

public 
botadd(idlevelcid)
{
    !!! 
Removed Phi
    
if (!cmd_access(idlevelcid1false))
    {
        return 
1;
    }
    new 
arg[10];
    new 
botNum 0;
    if (
read_argc() == 1)
    {
        
botNum 1;
    }
    else
    {
        
read_argv(1arg9);
        if (
equali(arg"@FILL"0))
        {
            
botNum get_maxplayers() - get_playersnum(1);
        }
        
botNum str_to_num(arg);
    }
    if (
botNum <= || botNum get_maxplayers() - get_playersnum(1))
    {
        
console_print(id"[OhMyWay] Invalid number of bots to add");
        return 
1;
    }
    new 
Float:botDelay get_pcvar_float(pDelay);
    
console_print(id"[OhMyWay] Adding %d bots with %.1f second delay for each"botNumbotDelay);
    
set_task(botDelay"createBot"0""0"a"botNum);
    
set_task(botDelay botNum 1"doneChanging"0""0""0);
    
changingBots 1;
    return 
1;
}

public 
botremove(idlevelcid)
{
    !!! 
Removed Phi
    
if (!cmd_access(idlevelcid1false))
    {
        return 
1;
    }
    new 
arg[10];
    new 
botNum 0;
    if (
read_argc() == 1)
    {
        
botNum 1;
    }
    else
    {
        
read_argv(1arg9);
        if (
equali(arg"@ALL"0))
        {
            
botNum botCount;
        }
        
botNum str_to_num(arg);
    }
    if (
botNum <= || botNum botCount)
    {
        
console_print(id"[OhMyWay] Invalid number of bots to remove");
        return 
1;
    }
    new 
Float:botDelay get_pcvar_float(pDelay);
    
console_print(id"[OhMyWay] Removing %d bots with %.1f second delay for each"botNumbotDelay);
    
set_task(botDelay"removeBot"0""0"a"botNum);
    
set_task(botDelay botNum 1"doneChanging"0""0""0);
    
changingBots 1;
    return 
1;
}

public 
client_putinserver(id)
{
    
set_pev(idpev_rendermode0);
    
is_user_ffbot[id] = 0;
    
ServerStatus();
    return 
0;
}

public 
client_disconnect(id)
{
    
is_user_ffbot[id] = 0;
    
ServerStatus();
    return 
0;
}

public 
createBot()
{
    !!! 
Removed Phi
    
new bool:UseAnotherName 0;
    new 
BotName[33];
    new 
UserNames[33][33];
    
UserNames[0] = 37420;
    new 
name_rand random_num(0namesread + -1);
    new 
endLoop name_rand + -1;
    if (
endLoop)
    {
        
endLoop namesread + -1;
    }
    new 
1;
    while (
<= 32)
    {
        if (
is_user_connected(x))
        {
            
get_user_name(xUserNames[x], 32);
        }
        
x++;
    }
}

public 
removeBot()
{
    new 
id 1;
    while (
id <= 32)
    {
        if (
is_user_ffbot[id][0][0])
        {
            
server_cmd("kick #%d"get_user_userid(id));
            
is_user_ffbot[id] = 0;
            
botCount += -1;
            return 
0;
        }
        
id++;
    }
    return 
0;
}

public 
doneChanging()
{
    
changingBots 0;
    return 
0;
}

public 
ServerStatus()
{
    !!! 
Removed Phi
    
if (!get_pcvar_num(pAuto))
    {
        return 
0;
    }
    if (
checkingStatus || changingBots)
    {
        return 
0;
    }
    
checkingStatus 1;
    new 
rnd 0;
    if (
botCount)
    {
        new 
id 1;
        while (
id <= 32)
        {
            if (
is_user_connected(id))
            {
                if (!
is_user_ffbot[id][0][0])
                {
                }
                else
                {
                    
rnd random_num(1100);
                    if (
rnd <= 10)
                    {
                        
set_user_frags(idget_user_frags(id) + 1);
                    }
                    
set_team(id);
                    new 
var2 Heap_4;
                    
var2[0] = 37880;
                    if (
get_user_team(idvar20))
                    {
                        
server_cmd("kick #%d"get_user_userid(id));
                        
is_user_ffbot[id] = 0;
                        
botCount += -1;
                    }
                }
            }
            
id++;
        }
    }
    new 
pnum get_playersnum(1);
    new 
maxplayers get_maxplayers();
    new 
ff_players get_pcvar_num(pPlayers);
    new 
Float:botDelay get_pcvar_float(pDelay);
    if (
maxplayers + -ff_players)
    {
        
ff_players maxplayers + -2;
        
set_pcvar_num(pPlayersff_players);
    }
    if (
botDelay <= 0.000)
    {
        
log_amx("ERROR: Please set ff_delay to a number higher than 0");
    }
    else
    {
        if (
ff_players pnum)
        {
            new 
addnum ff_players pnum;
            
set_task(botDelay"createBot"0""0"a"addnum);
            
set_task(botDelay addnum 1"doneChanging"0""0""0);
            
changingBots 1;
        }
        if (
ff_players pnum)
        {
            new 
removenum pnum ff_players;
            
removenum min(removenumbotCount);
            if (
removenum)
            {
                
set_task(botDelay"removeBot"0""0"a"removenum);
                
set_task(botDelay removenum 1"doneChanging"0""0""0);
                
changingBots 1;
            }
        }
    }
    
checkingStatus 0;
    return 
0;
}

public 
set_team(BotID)
{
    if (
cstrike_running())
    {
        
cs_set_user_team(BotID0_}:0);
    }
    return 
0;
}

public 
ReadNames()
{
    !!! 
Removed Phi
    
new botnames_file[128];
    
get_configsdir(botnames_file63);
    
format(botnames_file127"%s/SpecBots.txt"botnames_file);
    new 
botnames fopen(botnames_file"r");
    if (
botnames)
    {
        new 
data[35];
        while (!
feof(botnames))
        {
            if (
namesread >= 256)
            {
                
log_amx("MAX_NAMES exceeded, not all fake client names were able to load");
                
fclose(botnames);
            }
            
fgets(botnamesdata34);
            
trim(data);
            new 
len strlen(data);
            if (
>= len)
            {
                return 
0;
            }
            if (
data[len] - == 10)
            {
                
len--;
                
data[len] = 0;
            }
            if (
equal(data""0) || equal(data"#"1))
            {
            }
        }
        
fclose(botnames);
    }
    else
    {
        new 
failmsg[128];
        
formatex(failmsg128"Unable to read file \"%s\", it is required to load bot names from"botnames_file);
        
log_amx(failmsg);
        
set_fail_state(failmsg);
    }
    return 
0;

Supremache is offline
 



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 17:33.


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