This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[L4D & L4D2] Left 4 DHooks Direct (1.150) [06-May-2024]


Post New Thread Reply   
 
Thread Tools Display Modes
Beatles
Senior Member
Join Date: Feb 2014
Old 04-30-2022 , 17:06   Re: [L4D & L4D2] Left 4 DHooks Direct (1.100) [28-Apr-2022]
Reply With Quote #691

Hi Silver, I recently opened my server in L4D1, and I'm using this plugin:
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <left4dhooks>

new iDistance;

new 
bool:bTankPointsFrozen false;

public 
Plugin:myinfo 
{
    
name "L4D No Boss Rush",
    
author "Visor, Jahze, vintik, modified by Ash The 9th Survivor to L4D1",
    
version "2.1",
    
description "Stops distance points accumulating whilst the Tank are alive",
    
url "https://github.com/Attano/Equilibrium"
};

public 
OnPluginStart()
{
    
HookEvent("round_start"OnRoundStartEventHookMode_PostNoCopy);
    
HookEvent("tank_spawn"OnTankSpawnEventHookMode_PostNoCopy);
    
HookEvent("player_death"OnPlayerDeathEventHookMode_Post);
}

public 
OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    
UnFreezePoints();
}

public 
OnTankSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    if (
bTankPointsFrozen == false)
    {
        
PrintToChatAll("\x01[\x04NoBossRush\x01] Tank spawned. Freezing distance points!");
        
bTankPointsFrozen true;
        
FreezePoints();
    }
}

public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
IsPlayerTank(client))
    {
        
CreateTimer(0.1CheckForTanksDelayTIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
OnClientDisconnect(client
{
    if (
IsPlayerTank(client))
    {
        
CreateTimer(0.1CheckForTanksDelayTIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action:CheckForTanksDelay(Handle:timer
{
    if (
FindTank() == -1)
    {
        if (
bTankPointsFrozen == true
        {
            
PrintToChatAll("\x01[\x04NoBossRush\x01] Tank is dead. Unfreezing distance points!");
            
bTankPointsFrozen false;
            
UnFreezePoints();
        }
    }
}

FreezePoints() 
{
    
iDistance L4D_GetVersusMaxCompletionScore();
    
L4D_SetVersusMaxCompletionScore(0);
}

UnFreezePoints() 
{
    
L4D_SetVersusMaxCompletionScore(iDistance);
}

FindTank() 
{
    for (new 
1<= MaxClientsi++) 
    {
        if (
IsPlayerTank(i) && IsPlayerAlive(i)) 
        {
            return 
i;
        }
    }
    return -
1;
}

bool:IsPlayerTank(client)
{
    if (
client <= || !IsClientInGame(client) || GetClientTeam(client) != 3)
        return 
false;

    if (
GetEntProp(clientProp_Send"m_zombieClass") != 5)
        return 
false;

    return 
true;

I realized that the distance points are not frozen as it should be, I made changes and a lot of tests, everything indicates that "L4D_GetVersusMaxCompletionScore" and "L4D_SetVersusMaxCompletionScore" are not working, could you check that please?
Beatles is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-30-2022 , 17:28   Re: [L4D & L4D2] Left 4 DHooks Direct (1.100) [28-Apr-2022]
Reply With Quote #692

If you're switching form coop to Versus I noticed the scores are all bugged. Try changing to versus mode, then loading a new map. These commands work for me when I tested. Either that your you have an old version of Left4DHooks and GameData, update it all.
__________________
Silvers is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 04-30-2022 , 18:58   Re: [L4D & L4D2] Left 4 DHooks Direct (1.100) [28-Apr-2022]
Reply With Quote #693

Quote:
Originally Posted by Silvers View Post
If you're switching form coop to Versus I noticed the scores are all bugged. Try changing to versus mode, then loading a new map. These commands work for me when I tested. Either that your you have an old version of Left4DHooks and GameData, update it all.
Thank you very much for answering, I just did 3 tests, I did the previous tests on a local server, with the doubts that you left me when you gave me these instructions, I decided to do it on my server, but not just do it and that's it, because that's how I already know I knew it wasn't working, I checked my server.cfg to see if I put some coop cvar there without realizing it, I checked everything, I made changes to make sure that my server is truly running in versus, and in all the tests it gave me the same , the distance points are not frozen, unless what is wrong is the plugin that I am using, but I see it as correct.

The error is definitely in "L4D_GetVersusMaxCompletionScore" and "L4D_SetVersusMaxCompletionScore".

Or maybe I'm missing something, any more ideas bro?
Beatles is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-30-2022 , 19:44   Re: [L4D & L4D2] Left 4 DHooks Direct (1.100) [28-Apr-2022]
Reply With Quote #694

Windows or Linux?
__________________
Silvers is offline
Beatles
Senior Member
Join Date: Feb 2014
Old 04-30-2022 , 20:18   Re: [L4D & L4D2] Left 4 DHooks Direct (1.100) [28-Apr-2022]
Reply With Quote #695

Quote:
Originally Posted by Silvers View Post
Windows or Linux?
The test on my local server was on Windows, although I don't think that was valid, it's still worth checking out.
The tests I consider valid on my open server were on Linux.
Beatles is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-30-2022 , 20:49   Re: [L4D & L4D2] Left 4 DHooks Direct (1.100) [28-Apr-2022]
Reply With Quote #696

I think you have a problem with your code. When round_start is triggered iDistance will be 0, so you're always setting it to 0 and never getting the real value. Only set the distance when bTankPointsFrozen is true.
__________________
Silvers is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-28-2022 , 10:48   Re: [L4D & L4D2] Left 4 DHooks Direct (1.103) [28-May-2022]
Reply With Quote #697

Code:
1.104 (28-May-2022)
    - Fixed the new natives from the last update throwing errors in L4D1.

1.103 (28-May-2022)
    - L4D2: Added new natives:
        "L4D2_Charger_ThrowImpactedSurvivor" - To throw a Survivor like when they're flung by a Charger impacting nearby.
        "L4D2_Charger_StartCarryingVictim" - To carry a Survivor by a Charger.
        "L4D2_Charger_PummelVictim" - To pummel a specific Survivor by a Charger.
        "L4D2_Charger_EndPummel" - To end pummelling a Survivor by a Charger.

    - Various changes to the "left4dhooks.inc" include file. Thanks to "Vinillia" for fixing.
        - Added some missing params
        - Added some const qualifiers
        - Renamed some brief params
        - Changed some return types to any to avoid extra casting

    - When recompiling plugins changes maybe required to align with these fixes.

    - Updated: Plugin and test plugin.
    - Updated: "left4dhooks.inc" and "left4dhooks_stocks.inc" Include files.
    - Updated: "left4dhooks.l4d2.txt" GameData file.
__________________

Last edited by Silvers; 05-28-2022 at 14:02.
Silvers is offline
Alexmy
Senior Member
Join Date: Oct 2014
Location: Russian Federation
Old 05-31-2022 , 08:26   Re: [L4D & L4D2] Left 4 DHooks Direct (1.104) [28-May-2022]
Reply With Quote #698

Hi, Silvers. I'm trying to block the second tank on the map if the first tank is alive. In the game l4d2 it works, but not in l4d

PHP Code:
public Action L4D_OnSpawnTank(const float vector[3], const float qangle[3])
{
    if(
L4D2_GetTankCount() > 0)
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

Also L4D2_GetTankCount() > 0 it doesn't count correctly, you need to set 0 so that the second tank is blocked in l4d2
__________________
[/URL]
Alexmy is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-01-2022 , 11:04   Re: [L4D & L4D2] Left 4 DHooks Direct (1.105) [01-Jun-2022]
Reply With Quote #699

Code:
1.105 (01-Jun-2022)
    - L4D1: Fixed native "L4D2_GetTankCount" not reporting the correct value. Thanks to "Alexmy" for reporting.
__________________
Silvers is offline
Mr. Man
Veteran Member
Join Date: Mar 2011
Location: Huh?
Old 06-02-2022 , 01:39   Re: [L4D & L4D2] Left 4 DHooks Direct (1.105) [01-Jun-2022]
Reply With Quote #700

L4DHook log keeps throwing these errors (?):

Code:
02-Jun-2022 00:41:35  #### CALL g_hSDK_CTerrorGameRules_IsMissionFinalMap
02-Jun-2022 00:41:36  #### CALL g_hSDK_CDirector_GetGameModeBase
once at the beginning, then

Code:
02-Jun-2022 00:38:04  ##### DTR_CDirector_GetScriptValueInt
on repeat constantly, and

Code:
02-Jun-2022 00:41:40  #### CALL g_hSDK_CDirector_HasAnySurvivorLeftSafeArea
occasionally on repeat as well

And the logfile is getting larger by the second:

__________________

Last edited by Mr. Man; 06-02-2022 at 01:50.
Mr. Man 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 20:06.


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