AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [L4D2] Helms Deep Sourcemod Enabler (https://forums.alliedmods.net/showthread.php?t=311391)

canadianjeff 10-16-2018 01:19

[L4D2] Helms Deep Sourcemod Enabler
 
Description:
Allows for the running of the helms deep reborn map on a sourcemod server and responds to built in commands

Installation:
put l4d2_helmsdeep.smx into /addons/sourcemod/plugins

Credits:
everyone who helped me in the sourcemod discord server

The author of the map placed code inside the .vpk in a .nut file with the following code that would check if sourcemod was running and kick everyone who tried to join
Code:

        if ( !HelmsServerInfo.checked_plugins )
        {
                local metamodVersion = Convars.GetStr("metamod_version");
                local sourcemodVersion = Convars.GetStr("sourcemod_version");
       
                if ( !metamodVersion && !sourcemodVersion )
                        HelmsServerInfo.has_plugins = false;
                else
                        HelmsServerInfo.has_plugins = true;
               
                HelmsServerInfo.checked_plugins = true;
        }
       
        if ( HelmsServerInfo.has_plugins )
        {
                foreach( player in Players.Humans() )
                {
                        SendToServerConsole( "kickid " + player.GetSteamID() + " " + "This server is using plugins, please join a different server" );
                }
        }

what this plugin does is intercept the kickid command (with that matching string) and stop it from being used and allowing all players to join

Updates:
Now has better map detection (by request)
Psyk0tik (discord) has improved the donator command
Now it is menu driven to get the item you want
Has the cvar to enable or disable the donator menu
Updated Syntax (by request)
Now has spawn limits to prevent spamming

Psyk0tik 10-16-2018 02:09

Re: [L4D2] Helms Deep Sourcemod Enabler
 
I wasn't aware this was even an issue. Great job!



The authors of this map probably didn't want SM to conflict with the vscripts they use for the map.

Spirit_12 10-16-2018 02:38

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Update syntax!

canadianjeff 10-16-2018 03:59

Re: [L4D2] Helms Deep Sourcemod Enabler
 
the sourcecode is provided so if you want to modify it please do

Silvers 10-16-2018 05:27

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Good job, the alternative method I was telling people to hex edit and replace the code with spaces.


Mix of old and new syntax :grrr: and remove the .SMX it's not required since the plugin compiles on the forum when you click 'Get Plugin').

and what's this about?
PHP Code:

if (strcmp(sArgs"!donator"false) == 0

Something for your personal server? You should use command listener and to listen to sm_donator and not checking for /donator or !donator strings.

Right now ANYONE can join and type !donator to be given items, as many times as they want. Please keep this off the public release since it's totally unrelated to what this plugin is doing.

You don't need to CreateEntity to give the items, just use the function GivePlayerItem.

Psyk0tik 10-16-2018 08:03

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Quote:

Originally Posted by Silvers (Post 2619919)
Good job, the alternative method I was telling people to hex edit and replace the code with spaces.


Mix of old and new syntax :grrr: and remove the .SMX it's not required since the plugin compiles on the forum when you click 'Get Plugin').

and what's this about?
PHP Code:

if (strcmp(sArgs"!donator"false) == 0

Something for your personal server? You should use command listener and to listen to sm_donator and not checking for /donator or !donator strings.

Right now ANYONE can join and type !donator to be given items, as many times as they want. Please keep this off the public release since it's totally unrelated to what this plugin is doing.

You don't need to CreateEntity to give the items, just use the function GivePlayerItem.

LOL

THAT is probably one of the reasons why the authors don't want SM to run with the map. They won't get anymore donations if people just use SM to give players all the custom melee weapons when they type "!donator"!

I can see why this guy used a command listener for it. xD

Silvers 10-16-2018 09:28

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Quote:

Originally Posted by Crasher_3637 (Post 2619933)
LOL

THAT is probably one of the reasons why the authors don't want SM to run with the map. They won't get anymore donations if people just use SM to give players all the custom melee weapons when they type "!donator"!

I can see why this guy used a command listener for it. xD

That's actually part of the map? How lame. The command should be limited to that map only then. Since you're not listening for any command, why not RegConsoleCommand("sm_donator") ?

404UserNotFound 10-16-2018 19:21

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Quote:

Originally Posted by canadianjeff (Post 2619894)
The author of the map placed code inside the .vpk in a .nut file with the following code that would check if sourcemod was running and kick everyone who tried to join

Wouldn't this be fixable by extracting the VPK contents, and re-VPKing them without that .nut file?

Psyk0tik 10-16-2018 19:37

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Quote:

Originally Posted by 404UNF (Post 2619990)
Wouldn't this be fixable by extracting the VPK contents, and re-VPKing them without that .nut file?

From a server owner's perspective, that can be easier said than done.

404UserNotFound 10-16-2018 19:45

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Quote:

Originally Posted by Crasher_3637 (Post 2619995)
From a server owner's perspective, that can be easier said than done.

It'd take me about a minute to do it :P

Extract contents from VPK into a folder using GCFScape, delete .nut file, click and drag folder onto vpk.exe file in like, steamapps/common/Team Fortress 2/bin, done. VPK.exe generates a new VPK file of the map and whatever else, minus the .nut. Or, better yet, modify the .nut to make it harmless. I doubt the map requires the files existence to run. I'm not sure what a .nut file is either, nor am I sure how it would even get initialized (unless there's some entity in the map that calls it somehow?), but it sounds fairly easy to remove the damn thing outright.

canadianjeff 10-16-2018 20:14

Re: [L4D2] Helms Deep Sourcemod Enabler
 
@404UNF

if you modify a VPK file on the server the clients version will MISMATCH
just a heads up
yes you could modify the VPK to not include the NUT file but you would have to redistribute the new VPK to your clients
in L4D2 when a server sends content to clients when they join (ie VPK) they would need to restart the client for the new VPK to be "mounted"
and also it would conflict with the steam workshop version that the client has subscribed to
in this case... helms deep reborn
and on top of all this.... there is a client cvar cl_downloadfilter "none"
which would prevent clients from even downloading your new VPK

Lux 10-16-2018 20:30

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Quote:

Originally Posted by canadianjeff (Post 2619998)
@404UNF

if you modify a VPK file on the server the clients version will MISMATCH

Wut? you should test that before you say it as fact because you can change vpks there is only checking for ("Name" & "Version", in mission.txt) String dictionaries should be left untouched too only add to stringtable.
Also "Name" & "Version" checking is only done for matchmaking from what i'v noticed.


Quote:

Originally Posted by canadianjeff (Post 2619998)
yes you could modify the VPK to not include the NUT file but you would have to redistribute the new VPK to your clients

Ye clients don't need nut/nuc files they are all server sided like sm.

Psyk0tik 10-16-2018 20:55

Re: [L4D2] Helms Deep Sourcemod Enabler
 
Just to be clear here, you can modify VPK files for your server and it will carry over to clients, even if they have different versions, as long as you turn off sv_consistency. As Lux said, all vscripts are server-sided, so a client can have script.nut that has different content from your server's script.nut and the server would just use its own version.

Quote:

Originally Posted by 404UNF (Post 2619996)
It'd take me about a minute to do it :P

Extract contents from VPK into a folder using GCFScape, delete .nut file, click and drag folder onto vpk.exe file in like, steamapps/common/Team Fortress 2/bin, done. VPK.exe generates a new VPK file of the map and whatever else, minus the .nut. Or, better yet, modify the .nut to make it harmless. I doubt the map requires the files existence to run. I'm not sure what a .nut file is either, nor am I sure how it would even get initialized (unless there's some entity in the map that calls it somehow?), but it sounds fairly easy to remove the damn thing outright.

My point is that some server owners are ignorant to these things, just like how writing simple plugins can be complicated for many users.

Skyy 11-13-2018 10:02

Re: [L4D2] Helms Deep Sourcemod Enabler
 
I personally removed all of the authors .nut files associated with non-scripted events and recompiled; there are multiple instances of checking for sourcemod and metamod, and while this plugin will let you play, it doesn't prevent all instances of the scripts detecting and disabling certain aspects of the map that are just otherwise incompatible with sm/mm


All times are GMT -4. The time now is 18:38.

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