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

[l4d2] Smart Item Selector (v1.2) [5-Mar-2019]


Post New Thread Reply   
 
Thread Tools Display Modes
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 03-02-2019 , 01:13   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
Reply With Quote #11

Quote:
Originally Posted by PatriotGames View Post
lol! I reply to Marttt that the way to handle this issue is to manipulate the survivor's active weapon and you post some code to do just that...brilliant!

Thanks, Crasher.
Lmao, no prob.

By the way, one thing that I forgot to include in the snippet is resetting the g_bLast[client] bool. You can reset it in the OnClientPutInServer() forward (in case the map changes while g_bLast is set to true for them) and in the player_death event (in case player dies while g_bLast is set to true for them). You can also optionally reset it in the player_spawn event right before you call the timer to check for player items.
__________________
Psyk0tik is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-02-2019 , 10:11   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
Reply With Quote #12

Thanks Crasher, you have a better solution than mine, since I'm a newbie on these plugins I just suggested a workaround xD

Patriot, when the survivors are rescued from the closet they don't take the primary weapon (but give the others items).
I could reproduce this issue too using the "sm_respawn" plugin, when I kill some client and respawn him, the primary weapon isn't give.

I think this is because when they are "respawned", the survivors already got a primary weapon on hands.
Or maybe is another plugin I'm using, can you check? Thanks

Another point, the "l4d2_weapon_stocks_sis.inc" file from the main topic can't compile here, there is an error on WEPID_CHAINSAWID line (says it's duplicated)

Last edited by Marttt; 03-02-2019 at 14:51.
Marttt is offline
PatriotGames
AlliedModders Donor
Join Date: Feb 2012
Location: root@irs:/# rm -rf /
Old 03-02-2019 , 20:07   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
Reply With Quote #13

Quote:
Originally Posted by Marttt View Post
Thanks Crasher, you have a better solution than mine, since I'm a newbie on these plugins I just suggested a workaround xD

Patriot, when the survivors are rescued from the closet they don't take the primary weapon (but give the others items).
I could reproduce this issue too using the "sm_respawn" plugin, when I kill some client and respawn him, the primary weapon isn't give.

I think this is because when they are "respawned", the survivors already got a primary weapon on hands.
Or maybe is another plugin I'm using, can you check? Thanks

Another point, the "l4d2_weapon_stocks_sis.inc" file from the main topic can't compile here, there is an error on WEPID_CHAINSAWID line (says it's duplicated)
Respawned survivors are not receiving the configured primary because l4d2 has this default cvar:
Code:
survivor_respawn_with_guns 1    // (default: 1)  0: Just a pistol, 1: Downgrade of last primary weapon, 2: Last primary weapon.
Default value == 1, so survivors respawn with a primary thus blocking the sIs primary.

Add to your server.cfg
Code:
sm_cvar survivor_respawn_with_guns "0"
This will respawn them with the same weapon state as if it was their first spawn in the game and allow sIs full control over their weapon/items. I have this setting on my test server so it's not an issue, but I forgot that it is not a standard setting.

I should have included that info in the main post, but I'll add it now. Good catch!

Regarding the compile error, I've not seen that before. If you are compiling locally, which sm version are you using? Did you by chance modify code in the .sp or .inc file?

Thanks!
Patriot

Last edited by PatriotGames; 03-02-2019 at 20:26. Reason: Department of Redundancy Department
PatriotGames is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-02-2019 , 21:10   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
Reply With Quote #14

I'm using sourcemod 1.10

I get this error:
l4d2_weapon_stocks_sis.inc(98.) : error 050: constant 'WEPID_CHAINSAW' already defined

And thanks about the sm_cvar command, it worked!

Last edited by Marttt; 03-03-2019 at 09:03.
Marttt is offline
PatriotGames
AlliedModders Donor
Join Date: Feb 2012
Location: root@irs:/# rm -rf /
Old 03-02-2019 , 23:15   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
Reply With Quote #15

Quote:
Originally Posted by Marttt View Post
I'm using sourcemod 1.10

I get this error:
l4d2_weapon_stocks_sis.inc(9 : error 050: constant 'WEPID_CHAINSAW' already defined

And thanks about the sm_cvar command, it worked!
You're welcome!

WEPID_CHAINSAW is used in l4d2_weapon_stocks_sis.inc 2x, but in different enums which are used by different functions. I didn't include the chainsaw as a weapon choice in the plugin due to it causing server lag when multiple instances are spawned. That include has many weapon IDs that are not used in sIs, but I chose not to remove them in case of some future application.

sIs compiles without warnings or errors on sm 1.8 and 1.9, the later being the current stable release. 1.10 is a development branch and not stable, so I can't support issues that arise from that version. Something in sm 1.10 affects how the enums are handled, though it may or may not remain once the branch becomes stable.


Thanks again for your testing feedback.

Patriot

Last edited by PatriotGames; 03-03-2019 at 14:24.
PatriotGames is offline
PatriotGames
AlliedModders Donor
Join Date: Feb 2012
Location: root@irs:/# rm -rf /
Old 03-03-2019 , 17:45   Re: [l4d2] Smart Item Selector (v1.1) [1-Mar-2019]
Reply With Quote #16

Marttt,

I'm going to go ahead and remove the duplicate chainsaw reference in l4d2_weapon_stocks_sis.inc as it's really not needed, so sIs will compile error-free on sm 1.10. This change will be included in the 1.2 release, which will also include Crasher's active weapon select code and an option to allow sIs to change the "survivor_respawn_with_guns" cvar so server operators don't have to add it to their server.cfg.

These are simple changes, but they still have to be tested before I post the update. The new version should be out in a day or so.

Patriot
PatriotGames is offline
PatriotGames
AlliedModders Donor
Join Date: Feb 2012
Location: root@irs:/# rm -rf /
Old 03-05-2019 , 19:17   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #17

sIs Version 1.2 is out and includes a number of enhancements. Please be sure to download and install the updated translation file:

v1.2 (5-Mar-2019)
- Added cvar to choose which weapon is active after items are given.
- Added code to change game cvar "survivor_respawn_with_guns" value to "0"
- Added chat message that prints if the knife is selected but knife unlock plugin is not running (customized to each player, of course)
- Removed duplicate chainsaw entries in l4d2_weapon_stocks_sis.inc so sIs will compile on sm 1.10
- Updated translation file with new knife_warning chat message
- Added a formatted l4d2_smart_item_selector.cfg with all cvars in logical groups.

The formatted l4d2_smart_item_selector.cfg file can be downloaded from the main post. Simply replace your existing sIs config file with this new version.
Also added a .zip file with all of the individual files in the correct folder structure for easy installation or upgrade.


Enjoy!

Patriot

Last edited by PatriotGames; 03-06-2019 at 22:12. Reason: added .zip file
PatriotGames is offline
Skyy
AlliedModders Donor
Join Date: Jan 2010
Location: Toronto, Canada
Old 03-07-2019 , 03:54   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #18

it's great to see new plugins for lfd2 from new authors, especially public plugins like this that can benefit the community as a whole. keep up the great work.
Skyy is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 03-10-2019 , 12:33   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #19

can we choose weapons or other items for VIP players and admins, except for upgrades?
Darkwob is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 03-10-2019 , 12:36   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #20

can he choose a menu while in the game ?you can access it by typing a command in the chat.
Darkwob 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 19:42.


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