AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2] Rescue vehicle leave timer (https://forums.alliedmods.net/showthread.php?t=328500)

darkbret 11-12-2020 21:23

[L4D2] Rescue vehicle leave timer
 
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.

GsiX 11-13-2020 00:52

Re: [L4D2] Rescue vehicle leave timer
 
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.

Marttt 11-13-2020 06:19

Re: [L4D2] Rescue vehicle leave timer
 
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")

darkbret 11-13-2020 20:46

Re: [L4D2] Rescue vehicle leave timer
 
Quote:

Originally Posted by GsiX (Post 2724722)
...

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 :cry:

Quote:

Originally Posted by Marttt (Post 2724751)
...

Thank you for your advise. I will try. :)

HarryPotter 11-16-2020 09:55

Re: [L4D2] Rescue vehicle leave timer
 
Quote:

Originally Posted by Marttt (Post 2724751)
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

Psyk0tik 11-16-2020 10:30

Re: [L4D2] Rescue vehicle leave timer
 
Quote:

Originally Posted by HarryPotter (Post 2725149)
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);
        }
    }



HarryPotter 11-19-2020 08:50

Re: [L4D2] Rescue vehicle leave timer
 
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

user2000 11-19-2020 22:29

Re: [L4D2] Rescue vehicle leave timer
 
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

HarryPotter 11-19-2020 22:35

Re: [L4D2] Rescue vehicle leave timer
 
Quote:

Originally Posted by user2000 (Post 2725601)
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 


user2000 11-20-2020 07:48

Re: [L4D2] Rescue vehicle leave timer
 
Quote:

Originally Posted by HarryPotter (Post 2725604)
PHP Code:

PrintCenterTextAll 

or
PHP Code:

PrintHintTextToAll 

or
PHP Code:

PrintToChatAll 


ok thanks if it worked :)


All times are GMT -4. The time now is 10:15.

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