Raised This Month: $32 Target: $400
 8% 

[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, Asia
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, Asia
Old 11-19-2020 , 08:50   Re: [L4D2] Rescue vehicle leave timer
Reply With Quote #7

Rescue vehicle leave timer Version(2023/3/21 )
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 all custom map
-Works on l4d2 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:
l4d2

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


-Edit Github-
Latest version always here
__________________

Last edited by HarryPotter; 03-20-2023 at 19:17.
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, Asia
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 07:23.


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