AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [L4D/2]Incapped Weapons (https://forums.alliedmods.net/showthread.php?t=320829)

xZk 01-11-2020 13:23

[L4D/2]Incapped Weapons
 
13 Attachment(s)
Quote:


Plugin Obsolete!, please use this version:[L4D & L4D2] Incapped Weapons Patch by Silvers



Intro
As the survivors are by default almost useless if they are incapped, I wanted to publish this plugin to dispense that, and in addition to giving a somewhat simpler alternative, to manage to use all their weapons and give a possible solution for those who use Windows since bug spawn of weapons spawns on the map when the weapons are configured for your script in incapped mode ("WeaponType" "pistol").
Details
Survivors can switch all their weapons, but cannot use all(slot 4|5). Also you can filter weapons to use in "Attachment 179759"


Cvars:
PHP Code:

// 0:Disable, 1:Enable plugin
// Default: "1"
incapped_weapons_enable "1"

// 0:Disable, 1:Allow weapons of slot 1, -1: Allow only switch weapons of slot1
// Default: "1"
incapped_weapons_slot1 "1"

// 0:Disable, 1:Allow weapons of slot 2, -1: Allow only switch weapons of slot2
// -
// Default: "1"
incapped_weapons_slot2 "1"

// 0:Disable, 1:Allow weapons of slot 3, -1: Allow only switch weapons of slot3
// Default: "1"
incapped_weapons_slot3 "1"

// 0:Disable, 1:Allow weapons of slot 4, -1: Allow only switch weapons of slot4
// Default: "1"
incapped_weapons_slot4 "1"

// 0:Disable, 1:Allow weapons of slot 5, -1: Allow only switch weapons of slot5
// Default: "1"
incapped_weapons_slot5 "1"

// 0:Disable, 1:Force switch to primary weapon, 2: Force switch to secondary weapon
// Default: "1"
incapped_weapons_switch "1"

// 0:Disable, 1:Prevent give pistol on incapped
// -
// Default: "0"
incapped_weapons_blockgive "0" 

Admin Commands:
PHP Code:

"sm_iw_reload" //reload config data weapons list(incapped_weapons_classnamelist.cfg) 


Credits
Silvers: for let me using your forwards, and your code
BHaType: for your code to auto create data cfg


Changelog


Requirements:Conflicts:
Incapped Magnum 1.4
Incapped Grenade (Pipe/Molotov/Vomitjar)

Notes:

Rant:
-download the plugin from Attachment 179212, don't try to download from the Get Plugin, it won't work
-put Attachment 179759 in /addons/sourcemod/data/ folder if this file is not generated.
-this SM1.8 version or higher is needed to compile in addition to the required Mission and Weapons - Info Editor
-make sure you don't have any weapons modified with: "WeaponType" "pistol",
in your file: /addons/sourcemod/data/l4d_info_editor_weapons.cfg, because otherwise this plugin will be useless for you
-warning not to use the "map" command, to change maps instead use "sm_map" or "changelevel", in Linux it can cause crash.

strikeraot 01-14-2020 08:59

Re: [L4D2/L4D?]Incapped Weapons
 
the .cfg will be placed in\addons\sourcemod\configs?

strikeraot 01-14-2020 10:14

Re: [L4D2/L4D?]Incapped Weapons
 
Can't compile this plugin
Quote:

//// incapped_weapons.sp
//
// D:\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\incap ped_weapons.sp(293) : error 017: undefined symbol "RemoveEntity"
// D:\Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\incap ped_weapons.sp(174) : warning 204: symbol is assigned a value that is never used: "g_bLeft4Dead2"
//
// 1 Error.
//
// Compilation Time: 0.41 sec
// ----------------------------------------

Press enter to exit ...

strikeraot 01-14-2020 10:16

Re: [L4D2/L4D?]Incapped Weapons
 
can't load it, too
Quote:

] sm plugins load incapped_weapons
[SM] Plugin incapped_weapons.smx failed to load: Native "InfoEditor_GetString" was not found.

Silvers 01-14-2020 11:16

Re: [L4D2/L4D?]Incapped Weapons
 
And this is why I provide a ton of information in my posts, yet it's never enough.

Quote:

Originally Posted by strikeraot (Post 2680204)
the .cfg will be placed in\addons\sourcemod\configs?

Here: sourcemod/data/incapped_weapons_classlist.cfg

Quote:

Originally Posted by strikeraot (Post 2680222)
Can't compile this plugin

"RemoveEntity" - requires sourcemod 1.10.

"InfoEditor_GetString" requires Info Editor .inc file.

MasterMind420 01-14-2020 15:27

Re: [L4D2/L4D?]Incapped Weapons
 
im not sure if this plugin changes weapon type to pistol to allow this...however what ive discovered is with melee weapons changed to pistol weapon type u can use melee while incap...however a side effect of this...all survivor bots will pickup melee wespons now. Which is not a good thing, they suck at using them and will continuously pickup pistols and melee if next to each other. This has nothing to do with this plugin, only something I discovered in my own testing.

xZk 01-14-2020 16:58

Re: [L4D2/L4D?]Incapped Weapons
 
I updated this for to compile in sm1.8+ or higher
Quote:

2020-01-14 (v1.1)
* Remove unnecessary events for L4D1
* Compatibility with SM1.8+

Silvers 01-14-2020 17:04

Re: [L4D2/L4D?]Incapped Weapons
 
I will still fail to compile on the forum due to: #include <l4d_info_editor>

You *could* copy the natives/forwards from the include into the plugin without having to use the include, but this goes against the standard scripting practices on AM. Actually you could do this in combination with #tryinclude <> and check "#if !defined _info_editor_included" then define the natvies/forwards. Only thing if the include is ever updated and breaks backwards compatibility (I have no plans on this). For simple plugins/includes with few natives/forwards used I may do this more often. For DHooks I wouldn't.

xZk 01-14-2020 17:17

Re: [L4D2/L4D?]Incapped Weapons
 
ok I understand that it cannot be compiled on the forum, but my intension with the compitability in sm1.8 is because of the method that was (RemoveEntity) that I think is only from sm1.9+, I think I need to detail that it is not you must use the button Getplugin xd

Silvers 01-14-2020 17:27

Re: [L4D2/L4D?]Incapped Weapons
 
Quote:

Originally Posted by xZk (Post 2680312)
ok I understand that it cannot be compiled on the forum, but my intension with the compitability in sm1.8 is because of the method that was (RemoveEntity) that I think is only from sm1.9+, I think I need to detail that it is not you must use the button Getplugin xd

Ahh yeah I forgot about that. We should be forcing server owners to update to 1.10 anyway, more features etc.


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

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