Raised This Month: $ Target: $400
 0% 

[L4D2] Rescue vehicle leave timer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
darkbret
Junior Member
Join Date: Sep 2019
Old 11-12-2020 , 21:23   [L4D2] Rescue vehicle leave timer
Reply With Quote #1

Hello,

Since on a crowded server, when rescue vehicle arrived, survivors keep hanging around for farming points. I need a plugin when rescue vehicle arrived and a timer will display how many time left for vehicle leaving. If anyone not on rescue vehicle or zone, slay them all.
darkbret is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 11-13-2020 , 00:52   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #2

Man.. i thought i was cruel until i saw your post. Why not just create a Smoker particle around them and let them take damage slowly and steady? Now that real evil.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 11-13-2020 , 06:19   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #3

Cruel is having to restart an entire map because of 1 or 2 teammates.

So darkbret maybe is possible by hooking OnTouch in the rescue vehicle,

I think all "finales" with vehicles have that, usually, you can find which entity is by dumping the map with stripper and looking for "OnEntireTeamStartTouch" text.

Probably one of the entities with this is one of the rescue triggers. (e.g c1m4 is targetname = "trigger_escape")
__________________
Marttt is offline
darkbret
Junior Member
Join Date: Sep 2019
Old 11-13-2020 , 20:46   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #4

Quote:
Originally Posted by GsiX View Post
...
No, if just 1-2 players, tanks can easily kill them. But the problem is we have 5-6 players hanging around. Smoker too weak to handle them

Quote:
Originally Posted by Marttt View Post
...
Thank you for your advise. I will try.
darkbret is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Taipei
Old 11-16-2020 , 09:55   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #5

Quote:
Originally Posted by Marttt View Post
maybe is possible by hooking OnTouch in the rescue vehicle,
I maybe do something wrong,
does not work, I have tried it
PHP Code:
{
    
int entity FindEntityByClassname(-1"trigger_multiple");
    if(
entity == -1)
    {
        return;
    }

    
SDKHook(entitySDKHook_StartTouchOnStartTouch);
    
SDKHook(entitySDKHook_EndTouchOnEndTouch);
}

public 
void OnStartTouch(int entityint other)
{
    
PrintToChatAll("OnStartTouch: %d, other: %d"entityother); //didn't happen
    
    
if (bFinalVehicleReady && other && other <= MaxClients && IsClientInGame(other))
    {
        
g_bClientInVehicle[other] = true;
    }
}

public 
void OnEndTouch(int entityint other)
{
    
PrintToChatAll("OnEndTouch: %d, other: %d"entityother); //didn't happen
    
    
if (bFinalVehicleReady && other && other <= MaxClients && IsClientInGame(other))
    {
        
g_bClientInVehicle[other] = false;
    }

Spoiler
__________________

Last edited by HarryPotter; 11-16-2020 at 21:19.
HarryPotter is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 11-16-2020 , 10:30   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #6

Quote:
Originally Posted by HarryPotter View Post
I maybe do something wrong,
does not work, I have tried it
PHP Code:
{
    
int entity FindEntityByClassname(iFinalEscapeEnt"trigger_multiple");
    if(
entity == -1)
    {
        return;
    }

    
SDKHook(entitySDKHook_StartTouchOnStartTouch);
    
SDKHook(entitySDKHook_EndTouchOnEndTouch);
}

public 
void OnStartTouch(int entityint other)
{
    
PrintToChatAll("OnStartTouch: %d, other: %d"entityother); //didn't happen
    
    
if (bFinalVehicleReady && other && other <= MaxClients && IsClientInGame(other))
    {
        
g_bClientInVehicle[other] = true;
    }
}

public 
void OnEndTouch(int entityint other)
{
    
PrintToChatAll("OnEndTouch: %d, other: %d"entityother); //didn't happen
    
    
if (bFinalVehicleReady && other && other <= MaxClients && IsClientInGame(other))
    {
        
g_bClientInVehicle[other] = false;
    }

Spoiler
Try hooking the OnStartTouch and OnEndTouch outputs of the entity instead.
PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
    if (
entity MaxClients && IsValidEntity(entity) && StrEqual(classname"trigger_multiple"))
    {
        
HookSingleEntityOutput(entity"OnStartTouch"EventTriggerHook);
        
HookSingleEntityOutput(entity"OnEndTouch"EventTriggerHook);
    }
}

public 
void EventTriggerHook(const char[] outputint callerint activatorfloat delay)
{
    if (
caller MaxClients && IsValidEntity(caller) && activator <= MaxClients && IsClientInGame(activator))
    {
        if (
StrEqual(output"OnStartTouch"false))
        {
            
PrintToChatAll("%N started touching %d"activatorcaller);
        }
        else if (
StrEqual(output"OnEndTouch"false))
        {
            
PrintToChatAll("%N stopped touching %d"activatorcaller);
        }
    }

__________________
Psyk0tik is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Taipei
Old 11-19-2020 , 08:50   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #7

Rescue vehicle leave timer Version 1.4 (2022/8/10 )
When rescue vehicle arrived and a timer will display how many time left for vehicle leaving. If a player is not on rescue vehicle or zone, slay him

-Original Request by darkbret.
-Thanks to Marttt and Crasher_3637.


-Video-


-Feature-
-Works on l4d1/2 all value maps.
-Custom timer for each final map (edit data).
-Translation support
-The City Will Get Nuked After Countdown Time Passes
-Silvers F18 Airstrike

Apply to:
l4d1/2 both

-Require-
1. Left 4 DHooks Direct
2. [INC] Multi Colors

Updating translation:
Spoiler

-Convar-
Spoiler


Example Config:
PHP Code:
"rescue_vehicle"
{
    
"c2m5_concert"
    
{
        
"num"        "2"  //There are two escape Helicopters in Dark Carnival
        
"time"       "60" //set timer to escape (seconds)
        
"1"
        
{
            
"hammerid"        "792981" //find which entity is rescue vehicle entity(classname is "trigger_multiple") by dumping the map with stripper
        
}
        
"2"
        
{
            
"hammerid"        "793053" //DO NOT modify hammerid unless you know what it is
        
}
    }
    
    
"c7m3_port"
    
{
        
"num"        "0" //0=Turn off the plugin in this map
    


-Notice-
The plugin only supports all valve maps.
If you want to support custom map, find entity by yourself or pay me money

-Edit Github-
Latest version always here
Attached Files
File Type: zip l4d_rescue_vehicle_leave_timer v1.4.zip (42.6 KB, 18 views)
__________________

Last edited by HarryPotter; 09-10-2022 at 08:17. Reason: v1.4 release
HarryPotter is offline
user2000
Member
Join Date: Nov 2015
Location: Peru - Lima
Old 11-19-2020 , 22:29   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #8

would it be possible to make the countdown bigger to make it look better?

try changing line 308:

Quote:
PrintCenterTextAll
to
PrintHintText
but he couldn't

plz
user2000 is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Taipei
Old 11-19-2020 , 22:35   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #9

Quote:
Originally Posted by user2000 View Post
would it be possible to make the countdown bigger to make it look better?
PHP Code:
PrintCenterTextAll 
or
PHP Code:
PrintHintTextToAll 
or
PHP Code:
PrintToChatAll 
__________________
HarryPotter is offline
user2000
Member
Join Date: Nov 2015
Location: Peru - Lima
Old 11-20-2020 , 07:48   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #10

Quote:
Originally Posted by HarryPotter View Post
PHP Code:
PrintCenterTextAll 
or
PHP Code:
PrintHintTextToAll 
or
PHP Code:
PrintToChatAll 
ok thanks if it worked
user2000 is offline
Reply


Thread Tools
Display Modes

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 15:40.


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