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

[L4D & L4D2] Left 4 DHooks Direct (1.146) [21-Apr-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 02-16-2022 , 03:07   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #621

"Bool" > "bool"
__________________
Silvers is offline
WhatsAnName
Member
Join Date: Jun 2018
Old 02-16-2022 , 04:49   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #622

Quote:
Originally Posted by Silvers View Post
"Bool" > "bool"
i have it at "bool" but says already defined maybe bug?

l4d2_monsterbots(6).sp(1177) : error 021: symbol already defined: "L4D_IsFinaleActive"

your other dhooks work fine for me not in that order but spread elsewhere

PHP Code:
public Action L4D2_OnSendInRescueVehicle()
(
L4D2_IsTankInPlay());
if (
L4D_HasAnySurvivorLeftSafeArea()) 
http://bugs.alliedmods.net/show_bug.cgi?id=6100
WhatsAnName is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 02-16-2022 , 06:43   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #623

The function "L4D_IsFinaleActive" is defined in one of the left4dhooks include files. You have to remove it from "l4d2_monsterbots" or maybe "l4d2_monsterbots" is using the "Left 4 Dead Stocks Library" by "Mr. Zero" which I've included as part of Left4DHooks. So remove that include line.
__________________
Silvers is offline
WhatsAnName
Member
Join Date: Jun 2018
Old 02-16-2022 , 11:50   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #624

Quote:
Originally Posted by Silvers View Post
The function "L4D_IsFinaleActive" is defined in one of the left4dhooks include files. You have to remove it from "l4d2_monsterbots" or maybe "l4d2_monsterbots" is using the "Left 4 Dead Stocks Library" by "Mr. Zero" which I've included as part of Left4DHooks. So remove that include line.
well i tried what said and got this error

PHP Code:
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// l4d2_monsterbots(6).sp
//
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\l4d2_monsterbots(6).sp(126) : error 017: undefined symbol "L4D2_IsTankInPlay"
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\l4d2_monsterbots(6).sp(128) : error 017: undefined symbol "L4D_HasAnySurvivorLeftSafeArea"
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\l4d2_monsterbots(6).sp(130) : error 017: undefined symbol "L4D2_IsTankInPlay"
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\l4d2_monsterbots(6).sp(1182) : error 021: symbol already defined: "L4D_IsFinaleActive"
//
// 4 Errors.
//
// Compilation Time: 0.34 sec
// ----------------------------------------

Press enter to exit ... 

i also tried other includes before that but this is the edit code of it

PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
// #include <left4dhooks>
// #include <left4dhooks_silver>
#include <left4dhooks_stocks>
// #include <left4dhooks_lux_library>
// #include <left4dhooks_anim>
#define PLUGIN_VERSION "1.2.0"

public Plugin myinfo =
{
    
name "L4D2 Monster Bots",
    
author "Machine, Modified by Fwoosh",
    
description "Automated Special Infected Creator",
    
version PLUGIN_VERSION,
    
url "www.AlliedMods.net"
};

//////////////////////////////////////////////////////////
//Monster Types
//
//0 = Random (Smoker,Boomer,Hunter,Spitter,Jockey,Charger)
//1 = Smoker
//2 = Boomer
//3 = Hunter
//4 = Spitter
//5 = Jockey
//6 = Charger
//7 = Witch
//8 = Tank
//////////////////////////////////////////////////////////

int nummonsterstimerticknumoutrangenumsurvivors;
ConVar monstermaxbotsmonstertypemonstertype2monstertype3monstertype4monstertype5monstertype6;
ConVar monsterbotsonmonsterintervalmonsternodirectormonsterwitchrange;
Handle mTimer null;

public 
void OnPluginStart()
{
    
CreateConVar("monsterbots_version"PLUGIN_VERSION"L4D2 Monster Bots Version"FCVAR_NOTIFY|FCVAR_DONTRECORD);
    
monstermaxbots CreateConVar("monsterbots_maxbots""6""The maximum amount of monster bots"FCVAR_NOTIFYtrue0.0);
    
monstertype6 CreateConVar("monsterbots_type6""0""The second kind of special infected to spawn. Set to 9 to disable."FCVAR_NOTIFYtrue0.0);
    
monstertype5 CreateConVar("monsterbots_type5""0""The second kind of special infected to spawn. Set to 9 to disable."FCVAR_NOTIFYtrue0.0);
    
monstertype4 CreateConVar("monsterbots_type4""0""The second kind of special infected to spawn. Set to 9 to disable."FCVAR_NOTIFYtrue0.0);
    
monstertype3 CreateConVar("monsterbots_type3""0""The second kind of special infected to spawn. Set to 9 to disable."FCVAR_NOTIFYtrue0.0);
    
monstertype2 CreateConVar("monsterbots_type2""0""The second kind of special infected to spawn. Set to 9 to disable."FCVAR_NOTIFYtrue0.0);
    
monstertype CreateConVar("monsterbots_type""0""The first kind of special infected to spawn. Set to 9 to disable."FCVAR_NOTIFYtrue0.0);
    
    
monsterbotson CreateConVar("monsterbots_on""1""Is monster bots on?"FCVAR_NOTIFYtrue0.0);
    
monsterinterval CreateConVar("monsterbots_interval""10""How many seconds till another monster spawns"FCVAR_NOTIFYtrue0.0);
    
monsternodirector CreateConVar("monsterbots_nodirector""0""Shutdown the director?"FCVAR_NOTIFYtrue0.0);
    
monsterwitchrange CreateConVar("monsterbots_witchrange""0""The range from survivors that witch should be recycled"FCVAR_NOTIFYtrue0.0);
//    tankplay = CreateConVar("tankplay", "0", "tank", FCVAR_NOTIFY);

    
monsterbotson.AddChangeHook(MonsterBots_Switch);
//    tankplay.AddChangeHook(tankcheck);
    
    
HookEvent("round_start"Event_RoundStart);
    
HookEvent("round_end"Event_RoundEnd);
    
HookEvent("map_transition"Event_RoundEnd);
    
HookEvent("round_start_pre_entity"Event_RoundEnd);
    
HookEvent("round_start_post_nav"Event_RoundEnd);
    
HookEvent("infected_death"Game_Start);
    
    
AutoExecConfig(true"l4d2_monsterbots_config");
}

public 
Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    
int flags GetConVarFlags(FindConVar("z_max_player_zombies"));
    
SetConVarBounds(FindConVar("z_max_player_zombies"), ConVarBound_Upperfalse);
    
SetConVarFlags(FindConVar("z_max_player_zombies"), flags & ~FCVAR_NOTIFY);
}

public 
Action Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
{
    if(
mTimer)
    {
        
delete mTimer;
    }

    if(
monsterbotson.IntValue == 1
    {
        for(
int i 1<= MaxClientsi++)
        {
            if(
IsClientInGame(i) && IsFakeClient(i) && GetClientTeam(i) == && !IsTank(i))
            {
                
KickClient(i);
            }
        }
    }
}

public 
Action Game_Start(Event event, const char[] namebool dontBroadcast)
{
    if(!
mTimer)
    {
        
mTimer CreateTimer(3.0TimerUpdate_TIMER_REPEAT);
    }
}

public 
Action TimerUpdate(Handle timer)
{
    if (!
IsServerProcessing()) return;

    if (
monsterbotson.IntValue == 1)
    {
        if (
monsternodirector.IntValue == 1)
        {
            
int anyclient GetAnyClient();
            if (
anyclient 0)
            {
                
DirectorCommand(anyclient"director_stop");
            }
            
SetConVarInt(FindConVar("director_no_bosses"), 1);
            
SetConVarInt(FindConVar("director_no_specials"), 1);
            
SetConVarInt(FindConVar("director_no_mobs"), 1);
            
SetConVarInt(FindConVar("z_common_limit"), 0);
        }
        
SetConVarInt(FindConVar("z_max_player_zombies"), 8);

        
timertick += 3;
        if (
timertick >= monsterinterval.IntValue)
        {
            (
L4D2_IsTankInPlay());
            
CountMonsters();
            if (
L4D_HasAnySurvivorLeftSafeArea())
            {
                if (
L4D2_IsTankInPlay() == 0)
                {
//                    int bot = CreateFakeClient("Monster");
//                    if (bot > 0)
//                    {
                    
if (monstertype.IntValue != 9)
                    {
                        
int bot CreateFakeClient("Monster");
                        if (
bot 0)
                        {
                            
int monster monstertype.IntValue;
                            switch(
monster)
                            {
                                case 
0:
                                {
                                    
int random GetRandomInt(16);
                                    switch(
random)
                                    {
                                        case 
1:
                                            
SpawnCommand(bot"z_spawn_old""smoker auto");
                                        case 
2:
                                            
SpawnCommand(bot"z_spawn_old""boomer auto");
                                        case 
3:
                                            
SpawnCommand(bot"z_spawn_old""hunter auto");
                                        case 
4:
                                            
SpawnCommand(bot"z_spawn_old""spitter auto");
                                        case 
5:
                                            
SpawnCommand(bot"z_spawn_old""jockey auto");
                                        case 
6:
                                            
SpawnCommand(bot"z_spawn_old""charger auto");
                                    }
                                }
                                case 
1:
                                    
SpawnCommand(bot"z_spawn_old""smoker auto");
                                case 
2:
                                    
SpawnCommand(bot"z_spawn_old""boomer auto");
                                case 
3:
                                    
SpawnCommand(bot"z_spawn_old""hunter auto");
                                case 
4:
                                    
SpawnCommand(bot"z_spawn_old""spitter auto");
                                case 
5:
                                    
SpawnCommand(bot"z_spawn_old""jockey auto");
                                case 
6:
                                    
SpawnCommand(bot"z_spawn_old""charger auto");
                                case 
7:
                                    
SpawnCommand(bot"z_spawn_old""witch auto");
                                case 
8:
                                    
SpawnCommand(bot"z_spawn_old""tank auto");
                            }
                        }
                    }
                    if (
monstertype2.IntValue != 9)
                    {
                        
int bot CreateFakeClient("Monster");
                        if (
bot 0)
                        {
                            
int monster2 monstertype2.IntValue;
                            switch(
monster2)
                            {
                                case 
0:
                                {
                                    
int random GetRandomInt(16);
                                    switch(
random)
                                    {
                                        case 
1:
                                            
SpawnCommand(bot"z_spawn_old""smoker auto");
                                        case 
2:
                                            
SpawnCommand(bot"z_spawn_old""boomer auto");
                                        case 
3:
                                            
SpawnCommand(bot"z_spawn_old""hunter auto");
                                        case 
4:
                                            
SpawnCommand(bot"z_spawn_old""spitter auto");
                                        case 
5:
                                            
SpawnCommand(bot"z_spawn_old""jockey auto");
                                        case 
6:
                                            
SpawnCommand(bot"z_spawn_old""charger auto");
                                    }
                                }
                                case 
1:
                                    
SpawnCommand(bot"z_spawn_old""smoker auto");
                                case 
2:
                                    
SpawnCommand(bot"z_spawn_old""boomer auto");
                                case 
3:
                                    
SpawnCommand(bot"z_spawn_old""hunter auto");
                                case 
4:
                                    
SpawnCommand(bot"z_spawn_old""spitter auto");
                                case 
5:
                                    
SpawnCommand(bot"z_spawn_old""jockey auto");
                                case 
6:
                                    
SpawnCommand(bot"z_spawn_old""charger auto");
                                case 
7:
                                    
SpawnCommand(bot"z_spawn_old""witch auto");
                                case 
8:
                                    
SpawnCommand(bot"z_spawn_old""tank auto");
                            }
                        }
                    }
                    if (
monstertype3.IntValue != 9)
                    {
                        
int bot CreateFakeClient("Monster");
                        if (
bot 0)
                        {
                            
int monster3 monstertype3.IntValue;
                            switch(
monster3)
                            {
                                case 
0:
                                {
                                    
int random GetRandomInt(16);
                                    switch(
random)
                                    {
                                        case 
1:
                                            
SpawnCommand(bot"z_spawn_old""smoker auto");
                                        case 
2:
                                            
SpawnCommand(bot"z_spawn_old""boomer auto");
                                        case 
3:
                                            
SpawnCommand(bot"z_spawn_old""hunter auto");
                                        case 
4:
                                            
SpawnCommand(bot"z_spawn_old""spitter auto");
                                        case 
5:
                                            
SpawnCommand(bot"z_spawn_old""jockey auto");
                                        case 
6:
                                            
SpawnCommand(bot"z_spawn_old""charger auto");
                                    }
                                }
                                case 
1:
                                    
SpawnCommand(bot"z_spawn_old""smoker auto");
                                case 
2:
                                    
SpawnCommand(bot"z_spawn_old""boomer auto");
                                case 
3:
                                    
SpawnCommand(bot"z_spawn_old""hunter auto");
                                case 
4:
                                    
SpawnCommand(bot"z_spawn_old""spitter auto");
                                case 
5:
                                    
SpawnCommand(bot"z_spawn_old""jockey auto");
                                case 
6:
                                    
SpawnCommand(bot"z_spawn_old""charger auto");
                                case 
7:
                                    
SpawnCommand(bot"z_spawn_old""witch auto");
                                case 
8:
                                    
SpawnCommand(bot"z_spawn_old""tank auto");
                            }
                        }
                    }
                    if (
monstertype4.IntValue != 9)
                    {
                        
int bot CreateFakeClient("Monster");
                        if (
bot 0)
                        {
                            
int monster4 monstertype4.IntValue;
                            switch(
monster4)
                            {
                                case 
0:
                                {
                                    
int random GetRandomInt(16);
                                    switch(
random)
                                    {
                                        case 
1:
                                            
SpawnCommand(bot"z_spawn_old""smoker auto");
                                        case 
2:
                                            
SpawnCommand(bot"z_spawn_old""boomer auto");
                                        case 
3:
                                            
SpawnCommand(bot"z_spawn_old""hunter auto");
                                        case 
4:
                                            
SpawnCommand(bot"z_spawn_old""spitter auto");
                                        case 
5:
                                            
SpawnCommand(bot"z_spawn_old""jockey auto");
                                        case 
6:
                                            
SpawnCommand(bot"z_spawn_old""charger auto");
                                    }
                                }
                                case 
1:
                                    
SpawnCommand(bot"z_spawn_old""smoker auto");
                                case 
2:
                                    
SpawnCommand(bot"z_spawn_old""boomer auto");
                                case 
3:
                                    
SpawnCommand(bot"z_spawn_old""hunter auto");
                                case 
4:
                                    
SpawnCommand(bot"z_spawn_old""spitter auto");
                                case 
5:
                                    
SpawnCommand(bot"z_spawn_old""jockey auto");
                                case 
6:
                                    
SpawnCommand(bot"z_spawn_old""charger auto");
                                case 
7:
                                    
SpawnCommand(bot"z_spawn_old""witch auto");
                                case 
8:
                                    
SpawnCommand(bot"z_spawn_old""tank auto");
                            }
                        }
                    }
                    if (
monstertype5.IntValue != 9)
                    {
                        
int bot CreateFakeClient("Monster");
                        if (
bot 0)
                        {
                            
int monster5 monstertype5.IntValue;
                            switch(
monster5)
                            {
                                case 
0:
                                {
                                    
int random GetRandomInt(16);
                                    switch(
random)
                                    {
                                        case 
1:
                                            
SpawnCommand(bot"z_spawn_old""smoker auto");
                                        case 
2:
                                            
SpawnCommand(bot"z_spawn_old""boomer auto");
                                        case 
3:
                                            
SpawnCommand(bot"z_spawn_old""hunter auto");
                                        case 
4:
                                            
SpawnCommand(bot"z_spawn_old""spitter auto");
                                        case 
5:
                                            
SpawnCommand(bot"z_spawn_old""jockey auto");
                                        case 
6:
                                            
SpawnCommand(bot"z_spawn_old""charger auto");
                                    }
                                }
                                case 
1:
                                    
SpawnCommand(bot"z_spawn_old""smoker auto");
                                case 
2:
                                    
SpawnCommand(bot"z_spawn_old""boomer auto");
                                case 
3:
                                    
SpawnCommand(bot"z_spawn_old""hunter auto");
                                case 
4:
                                    
SpawnCommand(bot"z_spawn_old""spitter auto");
                                case 
5:
                                    
SpawnCommand(bot"z_spawn_old""jockey auto");
                                case 
6:
                                    
SpawnCommand(bot"z_spawn_old""charger auto");
                                case 
7:
                                    
SpawnCommand(bot"z_spawn_old""witch auto");
                                case 
8:
                                    
SpawnCommand(bot"z_spawn_old""tank auto");
                            }
                        }
                    }
                    if (
monstertype6.IntValue != 9)
                    {
                        
int bot CreateFakeClient("Monster");
                        if (
bot 0)
                        {
                            
int monster6 monstertype6.IntValue;
                            switch(
monster6)
                            {
                                case 
0:
                                {
                                    
int random GetRandomInt(16);
                                    switch(
random)
                                    {
                                        case 
1:
                                            
SpawnCommand(bot"z_spawn_old""smoker auto");
                                        case 
2:
                                            
SpawnCommand(bot"z_spawn_old""boomer auto");
                                        case 
3:
                                            
SpawnCommand(bot"z_spawn_old""hunter auto");
                                        case 
4:
                                            
SpawnCommand(bot"z_spawn_old""spitter auto");
                                        case 
5:
                                            
SpawnCommand(bot"z_spawn_old""jockey auto");
                                        case 
6:
                                            
SpawnCommand(bot"z_spawn_old""charger auto");
                                    }
                                }
                                case 
1:
                                    
SpawnCommand(bot"z_spawn_old""smoker auto");
                                case 
2:
                                    
SpawnCommand(bot"z_spawn_old""boomer auto");
                                case 
3:
                                    
SpawnCommand(bot"z_spawn_old""hunter auto");
                                case 
4:
                                    
SpawnCommand(bot"z_spawn_old""spitter auto");
                                case 
5:
                                    
SpawnCommand(bot"z_spawn_old""jockey auto");
                                case 
6:
                                    
SpawnCommand(bot"z_spawn_old""charger auto");
                                case 
7:
                                    
SpawnCommand(bot"z_spawn_old""witch auto");
                                case 
8:
                                    
SpawnCommand(bot"z_spawn_old""tank auto");
                                }    
                            }
                        }
                    }
                }
//            }    timertick = 0;
            
timertick 0;
        }
    }
}

public 
void MonsterBots_Switch(ConVar hVariable, const char[] strOldValue, const char[] strNewValue)
{
    if (
monsterbotson.IntValue == 0
    {
        if (
monsternodirector.IntValue == 1)
        {
            
SetConVarInt(FindConVar("director_no_bosses"), 0);
            
SetConVarInt(FindConVar("director_no_specials"), 0);
            
SetConVarInt(FindConVar("director_no_mobs"), 0);
            
SetConVarInt(FindConVar("z_common_limit"), 20);

            
int anyclient GetAnyClient();
            if (
anyclient 0)
            {
                
DirectorCommand(anyclient"director_start");
            }
        }
    }
}

public 
Action Kickbot(Handle timerany client)
{
    if (
IsClientInGame(client) && IsFakeClient(client)) 
        
KickClient(client);
}

void CountMonsters()
{
    
nummonsters 0;
    
char classname[32];
    
int monster monstertype.IntValue;
    
int monster2 monstertype2.IntValue;
    
int monster3 monstertype3.IntValue;
    
int monster4 monstertype4.IntValue;
    
int monster5 monstertype5.IntValue;
    
int monster6 monstertype6.IntValue;

    if (
monster != 7)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && IsFakeClient(i) && GetClientTeam(i) == 3)
            {
                
GetClientModel(iclassnamesizeof(classname));
                switch(
monster)
                {
                    case 
0:
                    {
                        if (
StrContains(classname"smoker") || StrContains(classname"boomer") || StrContains(classname"hunter") || StrContains(classname"spitter") || StrContains(classname"jockey") || StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
1:
                    {
                        if (
StrContains(classname"smoker"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
2:
                    {
                        if (
StrContains(classname"boomer"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
3:
                    {
                        if (
StrContains(classname"hunter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
4:
                    {
                        if (
StrContains(classname"spitter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
5:
                    {
                        if (
StrContains(classname"jockey"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
6:
                    {
                        if (
StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
8:
                    {
                        if (
StrContains(classname"hulk"))
                        {
                            
nummonsters++;
                        }
                    }
                }
            }
        }
    }
    else if (
monster == 7)
    {
        
int entitycount GetMaxEntities();
        for (
int j 1<= entitycountj++)
        {
            if (
IsValidEdict(j) && IsValidEntity(j))
            {
                
GetEdictClassname(jclassnamesizeof(classname));
                if (
StrEqual(classname"witch"))
                {
                    
nummonsters++;
                    if (
nummonsters == monstermaxbots.IntValue)
                    {
                        
float WitchPos[3], PlayerPos[3];
                        
GetEntPropVector(jProp_Send"m_vecOrigin"WitchPos);
                        for (
int i 1<= MaxClientsi++)
                        {
                            if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
                            {
                                
GetClientAbsOrigin(iPlayerPos);
                                
float distance GetVectorDistance(WitchPosPlayerPos);
                                if (
distance monsterwitchrange.FloatValue)
                                {
                                    
numoutrange++;
                                    
CountSurvivors();
                                    if (
numoutrange == numsurvivors)
                                    {
                                        
numoutrange 0;
                                        
RemoveEdict(j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
//monster 2
    
if (monster2 != 7)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && IsFakeClient(i) && GetClientTeam(i) == 3)
            {
                
GetClientModel(iclassnamesizeof(classname));
                switch(
monster2)
                {
                    case 
0:
                    {
                        if (
StrContains(classname"smoker") || StrContains(classname"boomer") || StrContains(classname"hunter") || StrContains(classname"spitter") || StrContains(classname"jockey") || StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
1:
                    {
                        if (
StrContains(classname"smoker"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
2:
                    {
                        if (
StrContains(classname"boomer"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
3:
                    {
                        if (
StrContains(classname"hunter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
4:
                    {
                        if (
StrContains(classname"spitter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
5:
                    {
                        if (
StrContains(classname"jockey"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
6:
                    {
                        if (
StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
8:
                    {
                        if (
StrContains(classname"hulk"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
9:
                    {
                        return;
                    }
                }
            }
        }
    }
    else if (
monster2 == 7)
    {
        
int entitycount GetMaxEntities();
        for (
int j 1<= entitycountj++)
        {
            if (
IsValidEdict(j) && IsValidEntity(j))
            {
                
GetEdictClassname(jclassnamesizeof(classname));
                if (
StrEqual(classname"witch"))
                {
                    
nummonsters++;
                    if (
nummonsters == monstermaxbots.IntValue)
                    {
                        
float WitchPos[3], PlayerPos[3];
                        
GetEntPropVector(jProp_Send"m_vecOrigin"WitchPos);
                        for (
int i 1<= MaxClientsi++)
                        {
                            if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
                            {
                                
GetClientAbsOrigin(iPlayerPos);
                                
float distance GetVectorDistance(WitchPosPlayerPos);
                                if (
distance monsterwitchrange.FloatValue)
                                {
                                    
numoutrange++;
                                    
CountSurvivors();
                                    if (
numoutrange == numsurvivors)
                                    {
                                        
numoutrange 0;
                                        
RemoveEdict(j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
//monster 3
    
if (monster3 != 7)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && IsFakeClient(i) && GetClientTeam(i) == 3)
            {
                
GetClientModel(iclassnamesizeof(classname));
                switch(
monster2)
                {
                    case 
0:
                    {
                        if (
StrContains(classname"smoker") || StrContains(classname"boomer") || StrContains(classname"hunter") || StrContains(classname"spitter") || StrContains(classname"jockey") || StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
1:
                    {
                        if (
StrContains(classname"smoker"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
2:
                    {
                        if (
StrContains(classname"boomer"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
3:
                    {
                        if (
StrContains(classname"hunter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
4:
                    {
                        if (
StrContains(classname"spitter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
5:
                    {
                        if (
StrContains(classname"jockey"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
6:
                    {
                        if (
StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
8:
                    {
                        if (
StrContains(classname"hulk"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
9:
                    {
                        return;
                    }
                }
            }
        }
    }
    else if (
monster3 == 7)
    {
        
int entitycount GetMaxEntities();
        for (
int j 1<= entitycountj++)
        {
            if (
IsValidEdict(j) && IsValidEntity(j))
            {
                
GetEdictClassname(jclassnamesizeof(classname));
                if (
StrEqual(classname"witch"))
                {
                    
nummonsters++;
                    if (
nummonsters == monstermaxbots.IntValue)
                    {
                        
float WitchPos[3], PlayerPos[3];
                        
GetEntPropVector(jProp_Send"m_vecOrigin"WitchPos);
                        for (
int i 1<= MaxClientsi++)
                        {
                            if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
                            {
                                
GetClientAbsOrigin(iPlayerPos);
                                
float distance GetVectorDistance(WitchPosPlayerPos);
                                if (
distance monsterwitchrange.FloatValue)
                                {
                                    
numoutrange++;
                                    
CountSurvivors();
                                    if (
numoutrange == numsurvivors)
                                    {
                                        
numoutrange 0;
                                        
RemoveEdict(j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
//monster 4
    
if (monster4 != 7)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && IsFakeClient(i) && GetClientTeam(i) == 3)
            {
                
GetClientModel(iclassnamesizeof(classname));
                switch(
monster2)
                {
                    case 
0:
                    {
                        if (
StrContains(classname"smoker") || StrContains(classname"boomer") || StrContains(classname"hunter") || StrContains(classname"spitter") || StrContains(classname"jockey") || StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
1:
                    {
                        if (
StrContains(classname"smoker"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
2:
                    {
                        if (
StrContains(classname"boomer"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
3:
                    {
                        if (
StrContains(classname"hunter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
4:
                    {
                        if (
StrContains(classname"spitter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
5:
                    {
                        if (
StrContains(classname"jockey"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
6:
                    {
                        if (
StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
8:
                    {
                        if (
StrContains(classname"hulk"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
9:
                    {
                        return;
                    }
                }
            }
        }
    }
    else if (
monster4 == 7)
    {
        
int entitycount GetMaxEntities();
        for (
int j 1<= entitycountj++)
        {
            if (
IsValidEdict(j) && IsValidEntity(j))
            {
                
GetEdictClassname(jclassnamesizeof(classname));
                if (
StrEqual(classname"witch"))
                {
                    
nummonsters++;
                    if (
nummonsters == monstermaxbots.IntValue)
                    {
                        
float WitchPos[3], PlayerPos[3];
                        
GetEntPropVector(jProp_Send"m_vecOrigin"WitchPos);
                        for (
int i 1<= MaxClientsi++)
                        {
                            if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
                            {
                                
GetClientAbsOrigin(iPlayerPos);
                                
float distance GetVectorDistance(WitchPosPlayerPos);
                                if (
distance monsterwitchrange.FloatValue)
                                {
                                    
numoutrange++;
                                    
CountSurvivors();
                                    if (
numoutrange == numsurvivors)
                                    {
                                        
numoutrange 0;
                                        
RemoveEdict(j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
//monster 5
    
if (monster5 != 7)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && IsFakeClient(i) && GetClientTeam(i) == 3)
            {
                
GetClientModel(iclassnamesizeof(classname));
                switch(
monster2)
                {
                    case 
0:
                    {
                        if (
StrContains(classname"smoker") || StrContains(classname"boomer") || StrContains(classname"hunter") || StrContains(classname"spitter") || StrContains(classname"jockey") || StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
1:
                    {
                        if (
StrContains(classname"smoker"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
2:
                    {
                        if (
StrContains(classname"boomer"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
3:
                    {
                        if (
StrContains(classname"hunter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
4:
                    {
                        if (
StrContains(classname"spitter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
5:
                    {
                        if (
StrContains(classname"jockey"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
6:
                    {
                        if (
StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
8:
                    {
                        if (
StrContains(classname"hulk"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
9:
                    {
                        return;
                    }
                }
            }
        }
    }
    else if (
monster5 == 7)
    {
        
int entitycount GetMaxEntities();
        for (
int j 1<= entitycountj++)
        {
            if (
IsValidEdict(j) && IsValidEntity(j))
            {
                
GetEdictClassname(jclassnamesizeof(classname));
                if (
StrEqual(classname"witch"))
                {
                    
nummonsters++;
                    if (
nummonsters == monstermaxbots.IntValue)
                    {
                        
float WitchPos[3], PlayerPos[3];
                        
GetEntPropVector(jProp_Send"m_vecOrigin"WitchPos);
                        for (
int i 1<= MaxClientsi++)
                        {
                            if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
                            {
                                
GetClientAbsOrigin(iPlayerPos);
                                
float distance GetVectorDistance(WitchPosPlayerPos);
                                if (
distance monsterwitchrange.FloatValue)
                                {
                                    
numoutrange++;
                                    
CountSurvivors();
                                    if (
numoutrange == numsurvivors)
                                    {
                                        
numoutrange 0;
                                        
RemoveEdict(j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
//monster 6
    
if (monster6 != 7)
    {
        for (
int i 1<= MaxClientsi++)
        {
            if (
IsClientInGame(i) && IsFakeClient(i) && GetClientTeam(i) == 3)
            {
                
GetClientModel(iclassnamesizeof(classname));
                switch(
monster2)
                {
                    case 
0:
                    {
                        if (
StrContains(classname"smoker") || StrContains(classname"boomer") || StrContains(classname"hunter") || StrContains(classname"spitter") || StrContains(classname"jockey") || StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
1:
                    {
                        if (
StrContains(classname"smoker"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
2:
                    {
                        if (
StrContains(classname"boomer"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
3:
                    {
                        if (
StrContains(classname"hunter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
4:
                    {
                        if (
StrContains(classname"spitter"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
5:
                    {
                        if (
StrContains(classname"jockey"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
6:
                    {
                        if (
StrContains(classname"charger"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
8:
                    {
                        if (
StrContains(classname"hulk"))
                        {
                            
nummonsters++;
                        }
                    }
                    case 
9:
                    {
                        return;
                    }
                }
            }
        }
    }
    else if (
monster6 == 7)
    {
        
int entitycount GetMaxEntities();
        for (
int j 1<= entitycountj++)
        {
            if (
IsValidEdict(j) && IsValidEntity(j))
            {
                
GetEdictClassname(jclassnamesizeof(classname));
                if (
StrEqual(classname"witch"))
                {
                    
nummonsters++;
                    if (
nummonsters == monstermaxbots.IntValue)
                    {
                        
float WitchPos[3], PlayerPos[3];
                        
GetEntPropVector(jProp_Send"m_vecOrigin"WitchPos);
                        for (
int i 1<= MaxClientsi++)
                        {
                            if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
                            {
                                
GetClientAbsOrigin(iPlayerPos);
                                
float distance GetVectorDistance(WitchPosPlayerPos);
                                if (
distance monsterwitchrange.FloatValue)
                                {
                                    
numoutrange++;
                                    
CountSurvivors();
                                    if (
numoutrange == numsurvivors)
                                    {
                                        
numoutrange 0;
                                        
RemoveEdict(j);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

void CountSurvivors()
{
    
numsurvivors 0;
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2)
        {
            
numsurvivors++;
        }
    }
}

bool IsTank(int i)
{
    
char classname[32];
    
GetClientModel(iclassnamesizeof(classname));
    if (
StrContains(classname"hulk"false) != -1)
        return 
true;
    return 
false;
}

stock int GetAnyClient()
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && (!IsFakeClient(i)))
        {
            return 
i;
        }
    }
    return 
0;
}

stock void SpawnCommand(int clientchar[] commandchar[] arguments "")
{
    if (
client)
    {
        
ChangeClientTeam(client3);
        
int flags GetCommandFlags(command);
        
SetCommandFlags(commandflags & ~FCVAR_CHEAT);
        
FakeClientCommand(client"%s %s"commandarguments);
        
SetCommandFlags(commandflags FCVAR_CHEAT);
        
CreateTimer(0.1Kickbotclient);
    }
}

stock void DirectorCommand(int clientchar[] command)
{
    if (
client)
    {
        
int flags GetCommandFlags(command);
        
SetCommandFlags(commandflags & ~FCVAR_CHEAT);
        
FakeClientCommand(client"%s"command);
        
SetCommandFlags(commandflags FCVAR_CHEAT);
    }
}

stock bool L4D_IsFinaleActive()
{
    return 
view_as<bool>timertick 40
    
//trying to finale check - change plugin spawn time if not then it does nothing or reset normal value
}

public 
Action L4D2_OnSendInRescueVehicle()
{
    
timertick 0;

WhatsAnName is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 02-16-2022 , 12:00   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #625

Quote:
Originally Posted by WhatsAnName
.
Remove comments from #include <left4dhooks>
PHP Code:
#include <left4dhooks> 
Also remove the method L4D_IsFinaleActive (line 1182) [Silvers already mentioned that]

Still seems that there are errors in the code logic, IMO you should open a thread on the scripting section instead.
This is kind cross/off topic.
__________________

Last edited by Marttt; 02-16-2022 at 12:14.
Marttt is offline
WhatsAnName
Member
Join Date: Jun 2018
Old 02-16-2022 , 13:36   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #626

Quote:
Originally Posted by Silvers View Post
The function "L4D_IsFinaleActive" is defined in one of the left4dhooks include files. You have to remove it from "l4d2_monsterbots" or maybe "l4d2_monsterbots" is using the "Left 4 Dead Stocks Library" by "Mr. Zero" which I've included as part of Left4DHooks. So remove that include line.
well i removed it and got this to work instead not sure what effects changing forward to public will do but the compiler let do it this way thanks for the info tho

PHP Code:
public Action L4D2_OnChangeFinaleStage(int &finaleType, const char [] arg)
{
    
L4D2_GetCurrentFinaleStage();
    if (
L4D2_GetCurrentFinaleStage() == 1)
    {
        
timertick 40;
    }
    
timertick += 3;

WhatsAnName is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 02-17-2022 , 03:39   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #627

Request: add a new function

PHP Code:
// Tells if client is doing stagger behavior
native bool IsClientStagger(int client
Spoiler
__________________

Last edited by HarryPotter; 02-17-2022 at 03:42.
HarryPotter is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 02-17-2022 , 03:52   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #628

Quote:
Originally Posted by HarryPotter View Post
Request: add a new function

PHP Code:
// Tells if client is doing stagger behavior
native bool IsClientStagger(int client
Spoiler


You can recreate the function in sourcepawn to avoid gamedata here is pesudo code enjoy

PHP Code:
bool __cdecl CTerrorPlayer::IsStaggering(CTerrorPlayer *this)
{
  
bool result// al

  
result 1;
  if ( 
this->CTerrorPlayer.m_iQueuedStaggerType == -)
    
result CTerrorPlayer::GetStaggerDir(this) != 0;
  return 
result;
}

bool *__cdecl CTerrorPlayer::GetStaggerDir(CTerrorPlayer *this)
{
  
long double v1// fst7
  
bool *result// eax
  
float v3// ST1C_4
  
float v4// xmm3_4
  
float v5// xmm0_4
  
float v6// xmm1_4
  
float v7// ST20_4

  
v1 CountdownTimer::Now();
  
result 0;
  
v3 v1;
  if ( 
v3 this->CTerrorPlayer.m_staggerTimer.m_timestamp )
  {
    
v4 this->CTerrorPlayer.m_staggerDist;
    if ( 
this->CBaseEntity.m_iEFlags EFL_DIRTY_ABSTRANSFORM )
    {
      
v7 this->CTerrorPlayer.m_staggerDist;
      
CBaseEntity::CalcAbsolutePosition(this);
      
v4 v7;
    }
    
result 0;
    
v5 this->CBaseEntity.m_vecAbsOrigin[1] - this->CTerrorPlayer.m_staggerStart[1];
    
v6 this->CBaseEntity.m_vecAbsOrigin[2] - this->CTerrorPlayer.m_staggerStart[2];
    if ( 
fsqrt(
           ((
v5 v5)
          + ((
this->CBaseEntity.m_vecAbsOrigin[0] - this->CTerrorPlayer.m_staggerStart[0])
           * (
this->CBaseEntity.m_vecAbsOrigin[0] - this->CTerrorPlayer.m_staggerStart[0])))
         + (
v6 v6)) <= v4 )
      
result this->CTerrorPlayer.m_staggerDir;
  }
  return 
result;

__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 02-17-2022 , 04:46   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #629

Thanks, will add.


Quote:
Originally Posted by WhatsAnName View Post
not sure what effects changing forward to public will do
That is normal to make the forward be called in your plugin. The word "forward" in front of the function in an include file shows that it's a forward and not something else.
__________________
Silvers is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 02-17-2022 , 07:42   Re: [L4D & L4D2] Left 4 DHooks Direct (1.87) [06-Feb-2022]
Reply With Quote #630

Quote:
Originally Posted by Lux View Post
You can recreate the function in sourcepawn to avoid gamedata here is pesudo code enjoy
thank you,

PHP Code:
bool IsPlayerStagger(int client)
{
    static 
int m_iQueuedStaggerType = -1;
    if( 
m_iQueuedStaggerType == -)
        
m_iQueuedStaggerType FindSendPropInfo("CTerrorPlayer""m_staggerDist") + 4;
    
    if( 
GetEntData(clientm_iQueuedStaggerType4) == -)
    {
        return 
GetEntPropFloat(clientProp_Send"m_staggerTimer"1) >= GetGameTime();
    }
    
    return 
true;

__________________
HarryPotter 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 03:05.


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