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

[L4D] L4D Tank announce and lock door (v1.1.7, 2022-01-02)


Post New Thread Reply   
 
Thread Tools Display Modes
ZBzibing
Senior Member
Join Date: Dec 2012
Old 11-20-2021 , 02:10   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #11

The plug-in worked very well until I added a new plug-in, which caused problems in his judgment of tanks.
https://forums.alliedmods.net/showpo...postcount=1371
When I play a tank in cooperative mode, the security door cannot be locked
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 11-30-2021 , 06:01   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #12

Quote:
Originally Posted by Silvers View Post
"IsClientConnected(i) && IsClientInGame(i)" - There's no need to check "IsClientConnected" because "IsClientInGame" already does that.

If you want to support L4D2, the "m_zombieClass" for tank is 8 in L4D2 and 5 in L4D1. Suggest something like "g_iClassTank = g_bLeft4Dead2 ? 8 : 5;" in plugin start, then checking against that var.
Is it possible to lock the safety gate by checking that the tank is alive? If there are multiple tanks, the mods are not accurate

The author should not be able to see the program, can you help correct it?
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 11-30-2021 , 11:41   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #13

Atm there is no support for l4d2 and the checks for finale maps RE hardcoded for l4d1 versus, you would have to put in coop names if you use coop.

The check for multiple living tanks is already there.

Keep in mind that it checks for l4d1 tank class and not for l4d2 i.e. class 5 and not 8



PHP Code:
"m_zombieClass") == 
PHP Code:
if (IsClientConnected(i) && IsClientInGame(i) &&  IsPlayerAlive(i) && GetEntProp(iProp_Send"m_zombieClass") == 5Tankcount++; 
            if(
Tankcount==0){
                if(!
IsFinaleMap()) {
                    
PrintToChatAll("[SM] The Tank is dead! The safehouse is open!");
                    
ControlDoor(iCheckpointDoorUNLOCK); 
it should only unlock when all tanks are dead


So you might want to change every occurance of "m_zombieClass") == 5 to "m_zombieClass") == 8

Put in the finale map names from l4d2 coop then too and it might work. I dont know since I ignore the existance of l4d2.

On a lighter note: I still have to add silvers suggestions too but... well... I am married with child, you know how life is....
__________________

Last edited by finishlast; 11-30-2021 at 12:15.
finishlast is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-30-2021 , 12:06   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #14

Don't need to hard code finale maps. You can do something like this:

PHP Code:
g_bIsFinale FindEntityByClassname(-1"trigger_finale") != INVALID_ENT_REFERENCE
As for detecting if Coop or Versus, many of my plugins show a way to detect all types of Versus modes regardless of mutation (L4D2) by using "info_gamemode" entity or use Left4DHooks GameMode native to find the current mode.
__________________

Last edited by Silvers; 11-30-2021 at 12:06.
Silvers is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 12-01-2021 , 03:21   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #15

I used a plugin that allowed me to play infected in co-op mode. When I was playing as a tank, the lock didn't work, but if the tank was playing as an AI, the mods would work, I was upset.
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 12-02-2021 , 02:33   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #16

Test L4D1 Map
COOP_MAP: L4D_SMALLTOWN04_MAINSTREET
VS_MAP: L4D_VS_SMALLTOWN04_MAINSTREET
The end point security door is invalid
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 12-02-2021 , 04:23   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #17

Quote:
Originally Posted by ZBzibing View Post
I used a plugin that allowed me to play infected in co-op mode. When I was playing as a tank, the lock didn't work, but if the tank was playing as an AI, the mods would work, I was upset.
tank_spawn->player_spawn
sorallll is offline
finishlast
Senior Member
Join Date: Nov 2018
Location: In Reno with the vitamin
Old 12-02-2021 , 13:28   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #18

Yeah, well if it doesn't fire tank_spawn it will not close the door.

What if you change the hook like sorallll suggested?

PHP Code:
//HookEvent("tank_spawn",     Event_PlayerSpawn, EventHookMode_Post);
HookEvent("player_spawn",     Event_PlayerSpawnEventHookMode_Post); 
Shouldn't really make a difference here since we still check for tank class.
So that might fix it for you?
__________________
finishlast is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 12-07-2021 , 15:22   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #19

Quote:
Originally Posted by finishlast View Post
Yeah, well if it doesn't fire tank_spawn it will not close the door.

What if you change the hook like sorallll suggested?

PHP Code:
//HookEvent("tank_spawn",     Event_PlayerSpawn, EventHookMode_Post);
HookEvent("player_spawn",     Event_PlayerSpawnEventHookMode_Post); 
Shouldn't really make a difference here since we still check for tank class.
So that might fix it for you?
Yes, it temporarily solves the problem. But it is not stable. If the tank is accidentally kicked off. Or the player madly presses the safety door, it will cause the tank to die, the door is not unlocked, or the tank, or the tank is locked without a door prompt. I I don’t know why I’m still testing, hundreds of times
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 12-07-2021 , 15:34   Re: [L4D] L4D Tank announce and lock door (v1.0.7, 2020-03-28)
Reply With Quote #20

A solution is to do that kind of checks inside a timer instead checking by player_death event.
I think that kick doesn't trigger player_death
__________________
Marttt 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 10:37.


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