Left 4 Dead 2

Left 4 Dead 2

4,953 ratings
Left 4 Lib
4
2
   
Award
Favorite
Favorited
Unfavorite
Game Content: Scripts, Miscellaneous
File Size
Posted
Updated
219.136 KB
22 Oct, 2021 @ 7:41am
16 Jun @ 2:08am
23 Change Notes ( view )

Subscribe to download
Left 4 Lib

In 1 collection by smilzo
Left 4 Fun
4 items
Description
This addon contains some shared VScript code that is used by my addons:

This addon is mandatory if you have one of the addons listed above. They will not work without this!


Centralized User System
L4L also contains a centralized user system that is shared among all my addons.
The system automatically assigns a user level to the joining player. The other addons will use this level to give/restrict access to certain features to that player.

The L4U user levels are:
  • Admin
  • Friend
  • User
  • Griefer
When you first host a local game with this and one of my other addons (Left 4 Fun, Left 4 Bots, Left 4 Lib), you (the host) are automatically added as admin and you will be admin on all the addons.

You can add other admins by editing the file 'ems/left4lib/cfg/admins.txt' or directly ingame with the following commands:
  • Via chat: !l4u add [player/character name] admin
  • Via console: scripted_user_func l4u,add,[player/character name],admin
Remove the admin with:
  • Via chat: !l4u remove [player/character name]
  • Via console: scripted_user_func l4u,remove,[player/character name]
At the same way you can assign a Friend or Griefer level to a player:
  • Via chat: !l4u add [player/character name] [friend/griefer]
  • Via console: scripted_user_func l4u,add,[player/character name],[friend/griefer]
And you can remove the assigned level the same way you remove admins.

The Friend and Griefer lists are saved into the files 'ems/left4lib/cfg/friends.txt' and 'ems/left4lib/cfg/griefers.txt'.
The players who do not belong to any of these lists are automatically given the normal User level.


Addon settings

L4L also has its own settings. You can find more details HERE[github.com].

Some of these settings (like hooks_chatcommand_trigger) affect all the addons that use this library.

You can change the settings by editing the file 'ems/left4lib/cfg/settings.txt'.


Compatibility

This should be fully compatible with any Admin System/VSLib version and most addons in general.


Are you a L4D2 modder?

You are free to use the features contained in this addon, if you want to. Technical details can be found in the form of comments inside the .nut files.
Only one thing i ask you: please, do not put the L4L files in your addon but consider referencing L4L as an external required addon like i do in L4F, L4B and L4G. Reason for this is that by duplicating this library you will create multiple versions of it making the addons using the library incompatible with each other.

More info can be found on the L4L GitHub Repository[github.com].


Like my mods?
Donations are not required but are greatly appreciated.
[ko-fi.com]
Popular Discussions View All (4)
2
29 Jan, 2023 @ 12:46am
Adding custom chat/damage hooks
Kerouha
0
16 Jun @ 2:53am
PINNED: Compatibility with other addons
smilzo
0
6 Sep @ 9:13am
Left 4 lib causes my melee and shove to be OP
Average Water Enjoyer
231 Comments
Hybrid 24 Nov @ 4:11pm 
Whenever I try to spawn a bot via Admin System, the bot fails to spawn and I get this error

[L4L][ERROR] HooksHub.InterceptChat - Exception in func 'L4LROOT': attempt to call 'null'
smilzo  [author] 23 Nov @ 7:32am 
@Sefo sounds like a known bug of the dedicated server that happens when you set the sb_all_bot_game cvar to 1.
If you want you can try the dev version of the addon you can find on github:
https://github.com/smilz0/Left4Bots/blob/main/out/Left4Bots2.vpk
and also Left 4 Lib:
https://github.com/smilz0/Left4Lib/blob/main/out/Left4Lib.vpk
Remove the sb_all_bot_game line from convars.txt and also make sure that no other addon/plugin sets that.
Sefo 23 Nov @ 6:51am 
As soon as I install this script together with SourceMod plugin "Restart Empty Server" ( https://forums.alliedmods.net/showthread.php?t=315367 ) - the server starts to crash instantly with the following error (Accelerator): KERNELBASE.dll + 0x14b472

Here is an example of such crash log: https://crash.limetech.org/ndrwjfso6yol

The crash happens when there are no players on the server and the plugin restarts it with a map change.

There are no errors in SourceMod logs. Here are the last lines of the server console before the crash:
1050 20.504985 L 11/23/2024 - 17:26:42: [SM] Changed map to "c11m2_offices"
1051 20.545715 Server is hibernating
1052 20.546792 ConVarRef test_progression_loop doesn't point to an existing ConVar

Help, please.

P. S.
I'm trying this on Windows, with the latest versions of the scripts (Left 4 Lib, Left 4 Bots 2) from the workshop. sourcemod-1.12.0-git7167
fr 20 Nov @ 9:30pm 
Game crashing :steamthumbsdown:
blayt_man 12 Nov @ 7:01pm 
it says it's installed but every mod listed says otherwise so. I Installed it again after uninstalling it. And it still doesn't work. >:(
Sleepy_blue 12 Nov @ 10:22am 
it breaks my viewmodel when using it with custom models
Shadowysn 23 Oct @ 10:48pm 
Two I found that cause issues are Spawn L4D1 survivors and 2019 2: Director's Cut (both use VSLib + outdated loading) but there are more that may not explain what they use, especially since 2019 2 didn't specify that it uses scripts or VSLib.
Shadowysn 23 Oct @ 10:47pm 
@Ritsu Sakuma
@LuizVinicius17
There's some old mods that use either:
- Outdated script loading methods that can cause conflicts with other script mods.
- VSLib which was handled messily and resulted in many conflicts with mods using it from old versions overriding new versions.

It's not really the fault of the 'Left 4' scripts since they work as intended with no other mods active, more so if you already uninstalled them since there's no way they can take effect at all.
Ritsu Sakuma 23 Oct @ 10:13pm 
But, I'll figure it out.
Ritsu Sakuma 23 Oct @ 10:10pm 
I really want to blame this addon for making it unable to some players to play this game.