Raised This Month: $12 Target: $400
 3% 

[L4D/2]Incapped Weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Plugin ID:
6891
Plugin Version:
1.5
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
incapped survivors can switch all your weapons
Unapprover:
Reason for Unapproving:
Unapproved by request of author
Old 01-11-2020 , 13:23   [L4D/2]Incapped Weapons
Reply With Quote #1

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 "incapped_weapons_classnamelist.cfg"


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 incapped_weapons.smx, don't try to download from the Get Plugin, it won't work
-put incapped_weapons_classnamelist.cfg 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.
Attached Files
File Type: sp Get Plugin or Get Source (incapped_weapons.sp - 388 views - 14.9 KB)

Last edited by xZk; 04-05-2020 at 22:00. Reason: v1.5
xZk is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 01-14-2020 , 08:59   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #2

the .cfg will be placed in\addons\sourcemod\configs?
strikeraot is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 01-14-2020 , 10:14   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #3

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 is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 01-14-2020 , 10:16   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #4

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.
strikeraot is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-14-2020 , 11:16   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #5

And this is why I provide a ton of information in my posts, yet it's never enough.

Quote:
Originally Posted by strikeraot View Post
the .cfg will be placed in\addons\sourcemod\configs?
Here: sourcemod/data/incapped_weapons_classlist.cfg

Quote:
Originally Posted by strikeraot View Post
Can't compile this plugin
"RemoveEntity" - requires sourcemod 1.10.

"InfoEditor_GetString" requires Info Editor .inc file.
__________________
Silvers is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 01-14-2020 , 15:27   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #6

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.
MasterMind420 is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 01-14-2020 , 16:58   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #7

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+

Last edited by xZk; 01-14-2020 at 16:59.
xZk is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-14-2020 , 17:04   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #8

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.
__________________

Last edited by Silvers; 01-14-2020 at 17:05.
Silvers is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 01-14-2020 , 17:17   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #9

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
xZk is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 01-14-2020 , 17:27   Re: [L4D2/L4D?]Incapped Weapons
Reply With Quote #10

Quote:
Originally Posted by xZk View Post
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.
__________________
Silvers is offline
Reply


Thread Tools
Display Modes

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 16:16.


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