This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Left 4 Dead 2 - CreateSurvivorBot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 12-17-2020 , 06:11   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #1

Quote:
Originally Posted by Dragokas View Post
OMG, so difficult. My mind refuses to understand what is happening there.
Code:
int fakebot = FindBotToTakeOver(); //search fake bot again
Can you, please, show what is that?
PHP Code:
int FindBotToTakeOver()
{
    for (
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            if (
IsFakeClient(i) && GetClientTeam(i)==TEAM_SURVIVORS && !HasIdlePlayer(i) && IsPlayerAlive(i))
                return 
i;
        }
    }
    return 
0;
}

bool HasIdlePlayer(int bot)
{
    if(
HasEntProp(botProp_Send"m_humanSpectatorUserID"))
    {
        
int client GetClientOfUserId(GetEntProp(botProp_Send"m_humanSpectatorUserID"));        
        if(
client && client <= MaxClients && IsClientInGame(client) && !IsFakeClient(client) && IsClientObserver(client))
        {
            return 
true;
        }
    }
    
    return 
false;

__________________

Last edited by HarryPotter; 12-17-2020 at 06:12.
HarryPotter is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-21-2020 , 17:42   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #2

hi, microleo!

Did you compile an extension directly from VS?

Quote:
Can't open include file: IExtensionSys.h: No such file or directory, (compiling source file ..\extension.cpp) C:\dev\sm\ExtensionSrc\msvc12\Extension.vcxpr oj C:\dev\sm\ExtensionSrc\sdk\smsdk_ext.h 41
Can't open include file: IExtensionSys.h: No such file or directory, (compiling source file ..\sdk\smsdk_ext.cpp) C:\dev\sm\ExtensionSrc\msvc12\Extension.vcxpr oj c:\dev\sm\extensionsrc\sdk\smsdk_ext.h 41
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
microleo
Junior Member
Join Date: Dec 2015
Old 12-21-2020 , 20:48   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #3

Quote:
Originally Posted by Dragokas View Post
hi, microleo!

Did you compile an extension directly from VS?

check your vs options:
1. Debug-left 4 dead 2 / Release-left 4 dead2
2. check Project Property (C/C++)->(General)->(Include Directories):
..;
..\sdk;
$(SOURCEMOD)\public;
$(MMSOURCE)\core;
$(MMSOURCE)\core\sourcehook;
$(SOURCEPAWN)\include;
$(AMTL);
$(AMTL)\amtl;
$(HL2SDKL4D2)\public;
$(HL2SDKL4D2)\public\engine;
$(HL2SDKL4D2)\public\game\server;
$(HL2SDKL4D2)\public\tier0;
$(HL2SDKL4D2)\public\tier1;

3.make sure that sdk are installed

Last edited by microleo; 12-21-2020 at 20:56.
microleo is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-23-2020 , 02:01   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #4

Thank you. That works. I had to manually set up environment variables.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-23-2020 , 02:34   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #5

microleo, I saw, you provided Linux signatures as well.
Do you have makefile script?

I'm receiving:
Code:
In file included from extension.cpp:34:0:
FunctionType.h:5:26: error: expected ‘)’ before ‘*’ token
 typedef bool (__thiscall *tagHandleCommand_JoinTeam)(CBaseEntity *_pPlayerEntity, int _TeamIndex, int _iSurvivorCharacter, bool _bForcedJoinSurvivor);
                          ^
FunctionType.h:6:1: error: ‘tagHandleCommand_JoinTeam’ does not name a type
 tagHandleCommand_JoinTeam fHandleCommand_JoinTeam = 0;
 ^~~~~~~~~~~~~~~~~~~~~~~~~
FunctionType.h:13:27: error: expected ‘)’ before ‘*’ token
 typedef void* (__thiscall *tagCTerrorPlayerRoundRespawn)(CBaseEntity* _pPlayerEntity);
                           ^
FunctionType.h:13:27: error: expected initializer before ‘*’ token
FunctionType.h:14:1: error: ‘tagCTerrorPlayerRoundRespawn’ does not name a type
 tagCTerrorPlayerRoundRespawn fCTerrorPlayerRoundRespawn = 0;
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Isn't it require __cdecl CC ?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-23-2020 , 12:43   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #6

Made a direct port (without extension).
Only difference - HandleCommand_JoinTeam is replaced by ChangeClientTeam(). I think, it's the same.
Added L4D1 support.
Attached Files
File Type: zip CreateSurvivorBot.zip (12.0 KB, 5776 views)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 12-23-2020 at 12:45.
Dragokas is offline
Ein
New Member
Join Date: May 2020
Old 01-06-2021 , 09:06   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #7

Does it work on the listen server?
Ein is offline
wyxls
Junior Member
Join Date: Jul 2010
Location: China
Old 04-15-2021 , 01:44   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #8

Quote:
Originally Posted by Dragokas View Post
Made a direct port (without extension).
Only difference - HandleCommand_JoinTeam is replaced by ChangeClientTeam(). I think, it's the same.
Added L4D1 support.
It's a bit confusing. Should I load both l4d and l4d2 .smx files if I'm running L4D2 server?
wyxls is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-16-2023 , 05:59   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #9

Quote:
Originally Posted by Dragokas View Post
Made a direct port (without extension).
Only difference - HandleCommand_JoinTeam is replaced by ChangeClientTeam(). I think, it's the same.
Added L4D1 support.

Please remove CreateSurvivorBot_Test.smx

It lets you basically respawn dead bots.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
doctorandthetardis11
New Member
Join Date: Dec 2021
Location: USA
Old 01-27-2024 , 16:09   Re: Left 4 Dead 2 - CreateSurvivorBot
Reply With Quote #10

Quote:
Originally Posted by Dragokas View Post
Made a direct port (without extension).
Only difference - HandleCommand_JoinTeam is replaced by ChangeClientTeam(). I think, it's the same.
Added L4D1 support.
I keep having an issue where sometimes tanks don't spawn in finales and I get an error like this in my console

Code:
CreatePlayerBot: Unable to create bot Tank - CreateFakeClient() returned NULL.
__________________
doctorandthetardis11 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 06:21.


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