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

[L4D2] Defib using Bots (Updated 09-25-2020)


Post New Thread Reply   
 
Thread Tools Display Modes
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 06-24-2015 , 13:47   Re: [L4D2] Defib using Bots (Updated 04-29-2015)
Reply With Quote #31

Quote:
Originally Posted by yurikon View Post
sorry for my poor english
a bug:
because of you never removes defib from Array if someone holding it.

MedsArray{item,item,defib someone holding, defib want to pickup,...}

public Action:L4D2_OnFindScavengeItem(client, &item)
{
...
for (new i = 0; i <= GetArraySize(MedsArray) - 1; i++)
{
if(IsDefibOwned(i)) continue;
GetEntPropVector(GetArrayCell(MedsArray, i), Prop_Send, "m_vecOrigin", Origin);
GetEntPropVector(client, Prop_Send, "m_vecOrigin", TOrigin);
new Float:distance = GetVectorDistance(TOrigin, Origin);
if (distance < 300)
{
item = GetArrayCell(MedsArray, i);
return Plugin_Changed;
}
}
}

i added
"if(IsDefibOwned(i)) continue;" to fixed it

and the code,i cant't read:
stock bool:ChangePlayerWeaponSlot(Client, weaponslot)
{
if (IsValidEdict(GetEdictClassname(GetPlayerWeap onSlot(Client, 3), weapon, sizeof(weapon))))
}
Hmm, you're correct, I did manage to forget to delete the picked up defibs from the Array, but that's easily fixed by adding a check in CheckForPickups, like this;
PHP Code:
else if(IsDefibOwned(entity))
            {
                for (new 
0<= GetArraySize(MedsArray) - 1i++)
                {
                    if (
entity == GetArrayCell(MedsArrayi))
                    {
                        
RemoveFromArray(MedsArrayi);
                    }
                }
            } 
I'll update the main post with this.

A for this code;
PHP Code:
stock bool:ChangePlayerWeaponSlot(Clientweaponslot)
{
    new 
iWeapon GetPlayerWeaponSlot(Clientweaponslot);
    if (
iWeapon MaxClients)
    {
        new 
String:weapon[32];
        if (
IsValidEdict(GetEdictClassname(GetPlayerWeaponSlot(Client3), weaponsizeof(weapon))))
        {
            if (
StrEqual(weapon"weapon_defibrillator"))
            {
                
FakeClientCommand(Client"use weapon_defibrillator");
                return 
true;
            }
        }
    }
    return 
false;

This is part of what even makes this plugin possible.

What it does is, it scans the bot's weapon slot 3 (Health kid/defib slot) to see if they have a defib, and if they do, the bot is forced to use the defib, have it as their current active weapon.
__________________
DeathChaos25 is offline
bazrael
Senior Member
Join Date: Jan 2010
Location: Where Lucy became superw
Old 12-06-2015 , 18:44   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #32

I found these messages in console of dedicated server while using commands.
PHP Code:
Morning: !regroup
You can
't CommandABot a non-Bot! [target1]
Morning: !resetbots
You can'
t CommandABot a non-Bot! [target1
Plugin worked well then so what did those messages mean?
bazrael is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 12-06-2015 , 21:10   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #33

Quote:
Originally Posted by bazrael View Post
I found these messages in console of dedicated server while using commands.
PHP Code:
Morning: !regroup
You can
't CommandABot a non-Bot! [target1]
Morning: !resetbots
You can'
t CommandABot a non-Bot! [target1
Plugin worked well then so what did those messages mean?
Oh don't worry about that, the debug commands try to command every survivor, this just means that one of the targets was not a survivor bot.
__________________
DeathChaos25 is offline
ElKapone14
Junior Member
Join Date: Oct 2013
Old 12-08-2015 , 05:32   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #34

Nice Plugin as always !

Sorry for asking this, it has nothing to do with this plugin but i don't know where to ask this question :
Do you have any idea when you'll release the plugin that makes bots using grenades ? I guess it'll not be for now, I just would like to know your progress in this.
ElKapone14 is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 12-08-2015 , 05:53   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #35

Quote:
Originally Posted by ElKapone14 View Post
Nice Plugin as always !

Sorry for asking this, it has nothing to do with this plugin but i don't know where to ask this question :
Do you have any idea when you'll release the plugin that makes bots using grenades ? I guess it'll not be for now, I just would like to know your progress in this.
__________________
DeathChaos25 is offline
ElKapone14
Junior Member
Join Date: Oct 2013
Old 12-08-2015 , 07:48   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #36

Ok ok.... Nice teasing ! c:
ElKapone14 is offline
ElKapone14
Junior Member
Join Date: Oct 2013
Old 12-08-2015 , 08:24   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #37

Oh and are you planning to make bots take the chainsaw and/or use explosive/fire ammo ? Maybe it's hard to do, i don't really know about coding stuff

Last edited by ElKapone14; 12-08-2015 at 08:25.
ElKapone14 is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 12-14-2015 , 18:35   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #38

Hoping this isn't abandoned yet...love to the the grenades being picked up, not essentially used but still.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-30-2015 , 04:24   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #39

Bots go all dumb and teleport off the building then die from hurt points in map and just fall off the edge trying to defib people who fell off and died
Lux is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 02-03-2016 , 14:36   Re: [L4D2] Defib using Bots (Updated 06-24-2015)
Reply With Quote #40

Quote:
Originally Posted by DeathChaos25 View Post
Oh don't worry about that, the debug commands try to command every survivor, this just means that one of the targets was not a survivor bot.
Why not include a quick check to see if the survivor is a bot?

Something like this from muukis:

Code:
stock bool:TOIsClientInGameBot(client)
{
	if (client > 0) return IsClientConnected(client) && IsFakeClient(client) && GetClientTeam(client) == 2;
	else return false;
}

Last edited by Merudo; 02-19-2016 at 15:06.
Merudo 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 05:54.


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