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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Alex101192
Senior Member
Join Date: Aug 2018
Old 05-27-2020 , 19:49   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #31

Quote:
Originally Posted by MasterMind420 View Post
...if someone is going to take advantage of any potential exploits on your server, maybe you should be watching them and banning them if you take it that seriously. No one expects you to use these plugins...lol In fact i'm pretty sure the authors of both could care less, don't like it? Learn to code and fix them yourself or simply don't use them. Coming onto a public forum and complaining the way you are gets you no where.
Sure bud. I will stay on my server 24 hours a day everyday without sleep to make sure no one is cheating cause apparently I have nothing else to do in my day than waste time doing what the plugin should do by itself. What a nice suggestion.

Last edited by Alex101192; 05-27-2020 at 19:51.
Alex101192 is offline
Alex101192
Senior Member
Join Date: Aug 2018
Old 05-27-2020 , 19:52   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #32

Quote:
Originally Posted by Mi.Cura View Post
I totally agree with MasterMind420.
If the plugin doesn't meet your expectations don't use it.
I have servers with this plugin, if players want to cheat by staying idle for a moment, remember that items can be disabled, and weapons for example can be random.
So staying idle can be bad or good, it depending on what he will receive.
Disable items like earning medkit for example.
That's such a lame way to justify the vulnerabilities of this plugin. Basically if the players want to cheat, they can do it. That's what you are saying.

I would have had more respect for you if you just threw an insult or something like that.

Last edited by Alex101192; 05-27-2020 at 19:53.
Alex101192 is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 06-04-2021 , 00:35   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #33

Quote:
Originally Posted by PatriotGames View Post
Introduction
Smart Item Selector (sIs) is based on [L4D & L4D2] Round Start Items Giver by kwski43, but takes "item giving" to another level.
sIs intelligently gives selected items to survivors each time they spawn and includes an option to give different items to VIP/admins.
This is my first public plugin so constructive feedback is welcome.


sIs Goals
Simplify: by eliminating the need for numerous timers there are fewer cvars to set and hopefully, increased reliability.
Add intelligence: only give items if they are needed or according to a prioritization system. No brute-force item giving and no excess item spawns.
Add VIP/admin options: offer server operators the option to give different items to VIP/admins based on one or more flags.
Add flexibility: give items anytime a player spawns (first spawn, bot takeover, rescue closet, re-spawn, joining an in-progress map, etc.) not just at round start.


The Prioritization System
sIs uses a 3-tier prioritization system comprised of base, random, and VIP item selections.
A base item selection is overridden by a random item selection and both of those are overridden by a VIP item selection.
However, an override will only occur for the same item type (i.e. a VIP primary weapon selection only overrides the other primary weapon selections).

1. Example: if you configure a base primary weapon and a random primary weapon and a vip primary weapon, survivors will receive a random primary weapon (overrides the base item)
but VIPs will receive the VIP weapon (overrides the base and random item).
2. Example: if you configure a base primary weapon and a random SECONDARY weapon and a VIP primary weapon, survivors will receive the base primary weapon and a random secondary weapon.
VIPs will receive the VIP primary weapon (overrides the base item) and a random secondary weapon.


Item Replacement Logic
1. Health Items: These always have priority. If a survivor has an ammo upgrade pack on their back and a health item is configured (base, random or VIP),
the health item will replace (but not destroy) the upgrade pack.
2. Default pistol: when a player spawns on the first map of a new campaign, he receives a default pistol. If you configured a secondary weapon selection AND set l4d2_sis_remove_pistol "1", sIs
will remove (destroy) the default pistol and replace it with the selected secondary weapon. This is done primarily to eliminate pistol drop clutter on large co-op servers when new items are given.
3. All other weapons/items: sIs looks at each survivor's weapon slots and if they are occupied (other than with a default pistol) it will not give them a new item.
VIP selections are the exception. If the VIP's existing weapon/item is not the configured VIP item, it will be replaced by the VIP selection, but not destroyed.

Note: incendiary and explosive ammo upgrades are treated as equal and mutually exclusive. If a survivor has either one of them and your item configuration calls for the other
ammo upgrade, the existing ammo upgrade will not be replaced. An argument can be made that either incendiary or explosive should have priority (I think explosive should), but I chose
not to make that judgement call for this first release. If there is sufficient need for a prioritized ammo selection, I will try to add it.


Using Vip/Admin flags:
Add one or more admin flags that should receive Vip/admin items to l4d2_sis_vip_flags Multiple flags are accepted, just don't separate them with spaces or other characters.
Players with any of those flags will receive the VIP/Admin items. This was done to provide greater flexibility for server operators when configuring VIP options.
To disable the VIP option, just set the VIP item cvars to zero. No need to remove the flag(s) from l4d2_sis_vip_flags setting.

1. Example: if you set l4d2_sis_vip_flags "a", only players with the "a" flag will recieve VIP items.
2. Example: if you set l4d2_sis_vip_flags "abo", players with either the "a", "b" or "o" (custom1) flag will receive VIP items.


Chat Message:
l4d2_sis_info_message 1 will display a message like this to each player if they are given items. The message is customized to only show the item(s) they received.




Thank You:
Dragokas - code review, help and ideas, and the Russian translation.
nosoop - example code to handle the weapon upgrade bitvec and optimization
Crasher_3637 - code review and optimization
Lux - code review
Silvers - for his great formatting
l4d Competitive community for creating the original l4d2_weapon_stocks.inc


Optional dependency for the Knife:
To use the knife option for a secondary weapon, your must have the [L4D2] Knife Unlock plugin by Silvers installed on your server.
Smart Item Selector checks for the Knife Unlock plugin and if it is not found, substitutes another melee weapon for the knife.


Bugs:
None so far...


To Do:
1. Add server message that reports if the knife unlock plugin is not running and which melee weapon will be substituted for the knife.
2. Release an update with support for l4d.


Possible Future Upgrade:
1. Add a menu for VIP/admins to configure a personalized equipment load-out. Data storage method TBD.
2. Add Silvers game mode toggle code so server operators can chose in which modes sIs is enabled.


CVars:
- All cvars, except for the plugin enable, VIP/admin flag,pistol replace, & active weapon slot cvars are set to 0 or off by default for easier configuration.
PHP Code:
// [L4D2] Smart Item Selector by Patriot Games
// Selectively gives items to survivors when they spawn and inlcudes VIP/admin options.
// ConVars for plugin "l4d2_smart_item_selector.smx"


/* ==========  Settings  ========== */

// Is the Smart Item Selector plugin enabled? 0=Plugin off, 1=Plugin on.
// -
// Default: "1"
l4d2_sis_enable "1"

// Send each player a message informing them which item(s) they recieved?. 0=off, 1=on.
// -
// Default: "0"
l4d2_sis_info_message "0"

// Weapon slot to equip after all weapons/items are given.
// 1=primary, 2=secondary, 3=throwable, 4=healthkit, 5=meds
// -
// Default: "1"
// Minimum: "1"
// Maximum: "5"
l4d2_sis_lastslot "1"

// Remove the default pistol before giving another secondary weapon?. 0=No, 1=Yes.
// Eliminates pistol drop clutter when another secondary is given.
// -
// Default: "1"
l4d2_sis_remove_pistol "1"

// Survivors with any of these flags will receive VIP/admin items.  Multiple flags are accepted (e.g. "abc")
// [example admin flags: a=Reservation, b=Generic, c=Kick, d=Ban, o=custom1, etc.]
// -
// Default: "a"
l4d2_sis_vip_flags "a"


/* ==========  Base Item Selections  ========== */

// Give survivors a Primary Weapon?
// 0=disable, 1=pump shotgun, 2=chrome shotgun, 3=spas shotgun, 4=autoshotgun, 5=smg, 6=smg silenced, 7=smg mp5, 8=M16, 9=AK47, 10=Desert rifle, 11=SG552, 12=Hunting rifle, 13=Scout sniper, 14=Military sniper, 15=AWP sniper
// -
// Default: "0"
l4d2_sis_primary_choice "0"

// Give survivors a Secondary Weapon?
// 0=disable, 1=magnum pistol, 2=knife (requires [L4D2]Knife Unlock plugin), 3=frying pan, 4=tonfa, 5=crowbar, 6=cricket bat, 7=baseball bat, 8=machete, 9=katana, 10=golf club, 11=fire axe, 12=electric guitar
// -
// Default: "0"
l4d2_sis_secondary_choice "0"

// Give survivors a Health Item? 0=disable, 1=medkit, 2=defib
// -
// Default: "0"
l4d2_sis_health_choice "0"

// Give survivors Meds? 0=disable, 1=pills, 2=adrenaline
// -
// Default: "0"
l4d2_sis_meds_choice "0"

// Give survivors a Throwable? 0=disable, 1=pipe bomb, 2=molotov, 3=bile jar
// -
// Default: "0"
l4d2_sis_throwable_choice "0"

// Give survivors an Upgrade? 0=disable, 1=laser, 2=incendiary ammo, 3=explosive ammo
// -
// Default: "0"
l4d2_sis_upgrade_choice "0"


/* ==========  Random Item Selections  ========== */

// Give survivors a random Primary Weapon? Overrides base primary weapon setting. 0=disable, 1=enable.
// -
// Default: "0"
l4d2_sis_random_primary "0"

// Give survivors a random Secondary Weapon? Overrides base secondary weapon setting. 0=disable, 1=enable.
// -
// Default: "0"
l4d2_sis_random_secondary "0"

// Give survivors a random Health item? Overrides base health item setting. 0=disable, 1=enable.
// -
// Default: "0"
l4d2_sis_random_health "0"

// Give survivors random Meds? Overrides base meds setting. 0=disable, 1=enable.
// -
// Default: "0"
l4d2_sis_random_meds "0"

// Give survivors a random Throwable? Overrides base throwable setting. 0=disable, 1=enable.
// -
// Default: "0"
l4d2_sis_random_throwable "0"

// Give survivors a random Upgrade? Overrides base upgrade settings. 0=disable, 1=enable.
// -
// Default: "0"
l4d2_sis_random_upgrade "0"


/* ==========  VIP Item Selections  ========== */

// Give VIPs a Primary Weapon? Overrides base and random primary settings.
// 0=disable, 1=pump shotgun, 2=chrome shotgun, 3=spas shotgun, 4=autoshotgun, 5=smg, 6=smg silenced, 7=smg mp5, 8=M16, 9=AK47, 10=Desert rifle, 11=SG552, 12=Hunting rifle, 13=Scout sniper, 14=Military sniper, 15=AWP sniper
// -
// Default: "0"
l4d2_sis_vip_primary_choice "0"

// Give VIPs a Secondary Weapon? Overrides base and random secondary settings.
// 0=disable, 1=magnum pistol, 2=knife (requires [L4D2]Knife Unlock plugin), 3=frying pan, 4=tonfa, 5=crowbar, 6=cricket bat, 7=baseball bat, 8=machete, 9=katana, 10=golf club, 11=fire axe, 12=electric guitar
// -
// Default: "0"
l4d2_sis_vip_secondary_choice "0"

// Give VIPs a Health Item?  Overrides base and random health settings.
// 0=disable, 1=medkit, 2=defib
// -
// Default: "0"
l4d2_sis_vip_health_choice "0"

// Give VIPs Meds?  Overrides base and random meds settings.
//0=disable, 1=pills, 2=adrenaline
// -
// Default: "0"
l4d2_sis_vip_meds_choice "0"

// Give VIPs a Throwable?  Overrides base and random throwable settings.
//0=disable, 1=pipe bomb, 2=molotov, 3=bile jar
// -
// Default: "0"
l4d2_sis_vip_throwable_choice "0"

// Give VIPs an Upgrade?  Overrides base and random upgrade settings.
// 0=disable, 1=laser, 2=incendiary ammo, 3=explosive ammo
// -
// Default: "0"
l4d2_sis_vip_upgrade_choice "0" 
Changes:
PHP Code:
 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
    
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.

1.1 (1-Mar-2019)
    - 
corrected mismatched config and selection values for primary and melee weapons
    
reformatted wrapped cvar descriptions so all values print in the cfg file

1.0 
(24-Feb-2019)
    - 
Initial release

Compiling:
1. Put the l4d2_weapon_stocks_sis.inc include into your \addons\sourcemod\scripting\include\ folder.
2. Put the plugins .sp file into your scripting folder and compile the plugin.


Installation: individual files
1. Put the l4d2_smart_item_selector.smx file in your server's \addons\sourcemod\plugins\ folder.
2. Put the l4d2_smart_item_phrases.txt file in your server's \addons\sourcemod\translations\ folder.
3. Restart your server and then set your item preferences in the \cfg\sourcemod\l4d2_smart_item_selector.cfg file.
4. Restart your server or change the map.

Installation: zip file
1. Extract the SmartItemSelector.zip file.
2. Copy/upload all the files into their respective folders on your server.
3. Restart your server.
hi bro, in this plugin I want to give different flags, different weapons, although I play with the codes, nothing happens so he doesn't give a gun. There are no error logs in the logs. If you have time can you take a look at this? I want to give different weapon modifications to 5 different flags.

I want to give the weapon I want, melee, throw, health items to someone with the "a" flag. Or someone with a "b" flag. "l4d2_sis_vip_flags" in the same plugin 5 of this cvar and 5 vip cvars.


I need 5 of these cvarla. I wanted to do this by trying to play with the codes, but I could not succeed.

Also I guess this seems to be a problem when a dead player replaces a bot on the Server with the Takeover addon, he can get everything back. can you add this with active or inactive option? When active, vip items will be restored every time it spawns, 0, but will not receive anything when spawned while inactive.
PHP Code:
Default: "a"
l4d2_sis_vip_flags "a"

// Give VIPs a Health Item? Overrides ALL health item settings. 0=disable, 1=medkit, 2=defib
// -
// Default: "0"
l4d2_sis_vip_health_choice "1"

// Give VIPs Meds? Overrides ALL meds settings. 0=disable, 1=pills, 2=adrenaline
// -
// Default: "0"
l4d2_sis_vip_meds_choice "1"

// Give VIPs a Primary Weapon?
// 0=disable, 1=pump shotgun, 2=chrome shotgun, 3=spas shotgun, 4=autoshotgun, 5=smg, 6=smg silenced, 7=smg mp5, 8=M16, 9=AK47, 10=Desert rifle, 11=SG552, 12=Hunting rifle, 13=Scout sniper, 14=Military sniper, 15=AWP sniper
// -
// Default: "0"
l4d2_sis_vip_primary_choice "15"

// Give VIPs a Secondary Weapon?
// 0=disable, 1=magnum pistol, 2=knife (requires [L4D2]Knife Unlock plugin), 3=frying pan, 4=tonfa, 5=crowbar, 6=cricket bat, 7=baseball bat, 8=machete, 9=katana, 10=golf club, 11=fire axe, 12=electric guitar
// -
// Default: "0"
l4d2_sis_vip_secondary_choice "8"

// Give VIPs a Throwable? Overrides ALL throwable settings. 0=disable, 1=pipe bomb, 2=molotov, 3=bile jar
// -
// Default: "0"
l4d2_sis_vip_throwable_choice "1"

// Give VIPs an Upgrade? Overrides ALL upgrade settings. 0=disable, 1=laser, 2=incendiary ammo, 3=explosive ammo
// -
// Default: "0"
l4d2_sis_vip_upgrade_choice "0" 

Last edited by Darkwob; 06-04-2021 at 00:36.
Darkwob is offline
thewintersoldier97
Senior Member
Join Date: Aug 2021
Location: Vietnam
Old 12-07-2021 , 11:54   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #34

Great plugin! Shame we won't see those upgrade feature though.
__________________

Looking for some fun!
thewintersoldier97 is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 02-03-2022 , 13:31   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #35

Quote:
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\ include\l4d2_weapon_stocks_sis.inc(185) : error 174: symbol 'WeaponId' is a type and cannot be used as a value
// C:\Program Files (x86)\Steam\steamapps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\scripting\ include\l4d2_weapon_stocks_sis.inc(192) : error 174: symbol 'MeleeWeaponId' is a type and cannot be used as a value
hope this one will be fixed, it seems this plugin cannot be compiled on sm1.11

Last edited by strikeraot; 02-03-2022 at 13:35.
strikeraot is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 02-09-2022 , 22:45   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #36

Quote:
Originally Posted by Alex101192 View Post
Nobody said it was simple. But you can't expect anyone to run this on a serious public server meant to be played by random people.

I had similar issues with ABM (multislot like plugin). I wasn't aware of it at first. Then one day I joined a game and found out that players were constantly quitting and joining back to have 100hp full of health back.
You can't expect anyone to use plugins like these on public server apart from maybe tournaments and competitive games where there is people watching in real time.
With this plugin I can already think of a situation where VIP players intentionally give their pills to somebody else then join back to get one more and spawn infinite items.

Superversus for example deals with this problem by simply making it so that players who rejoin back respawn dead instead of spawning alive with 100hp. This simple change alone prevents the exploit.
Something similar can be done with this plugin. When you quit and join back, you won't get a the item. Same method of superversus. And then allow the server administrator to choose whether the item should be given again on next round or if only on the next campaign.

As of right now the plugin is basically just a server side exploit that people can take advantage of to break the game.

I understand this is harder work, but you really cannot expect people to use something like this on a public server and deal with it.

Players should at the very least be informed in the description that this plugin basically gives griefers and cheaters a way to cheat and exploit the game without ripercussion.

Admins who have experience with this sort of things will know about it, but all the others will just install the plugin unaware of the consequences.
just simply hook another event instead of this and your problem will be solved, i can pm you my version if you still need one SiS does not deal with some specific situations like yours
PHP Code:
HookEvent("player_spawn"Event_PlayerSpawn); 
strikeraot is offline
WinterLady
Junior Member
Join Date: May 2023
Old 06-11-2023 , 06:40   Re: [l4d2] Smart Item Selector (v1.2) [5-Mar-2019]
Reply With Quote #37

Quote:
Originally Posted by strikeraot View Post
hope this one will be fixed, it seems this plugin cannot be compiled on sm1.11
I had the same problem, so I updated the problematic one. Replace the one in `addons\sourcemod\scripting\include` with this.
I hope this works!
Attached Files
File Type: inc l4d2_weapon_stocks_sis.inc (10.6 KB, 37 views)

Last edited by WinterLady; 06-11-2023 at 06:42.
WinterLady 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 08:57.


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