Raised This Month: $ Target: $400
 0% 

[L4D2] Stripper help with deleting defibs


Post New Thread Reply   
 
Thread Tools Display Modes
Austin
Senior Member
Join Date: Oct 2005
Old 07-08-2022 , 04:09   Re: [L4D2] Stripper help with deleting defibs
Reply With Quote #11

Quote:
Originally Posted by moschinovac View Post

if u want convert defib to pills or something

Code:
MutationOptions <- 
{
        weaponsToConvert =
	{
		weapon_defibrillator = "weapon_pain_pills_spawn"
	}

	function ConvertWeaponSpawn( classname )
	{
		if ( classname in weaponsToConvert )
		{
			return weaponsToConvert[classname];
		}
		return 0;
	}
}
Problem of this method is thats will completely remove item from maps. U cant get that in anyway, even cheats. (thats affect some plugins like drop items from SI)
The testing I did shows this code will only change
weapon_defibrillator_spawn
to
weapon_pain_pills_spawn

It doesn't do anything to
weapon_defibrillator

So if the map has a placed weapon_defibrillator it will remain after this script runs.
And the .nut file I posted will also leave weapon_defibrillator in the map after it runs.

The difference is the one I posted removes weapon_defibrillator_spawn and this one changes it into weapon_pain_pills_spawn

The $$ question is do these scripts affect defibs that are auto added by the director.
I am begenning to think they will not.

Getting rid of these DIRECTOR AUTO added defibs (without using a SM plugin) is the challenge that remains...
Austin is offline
moschinovac
Member
Join Date: Mar 2019
Location: Vietnam
Old 07-08-2022 , 04:58   Re: [L4D2] Stripper help with deleting defibs
Reply With Quote #12

Quote:
Originally Posted by Austin View Post
The testing I did shows this code will only change
weapon_defibrillator_spawn
to
weapon_pain_pills_spawn

It doesn't do anything to
weapon_defibrillator

So if the map has a placed weapon_defibrillator it will remain after this script runs.
And the .nut file I posted will also leave weapon_defibrillator in the map after it runs.

The difference is the one I posted removes weapon_defibrillator_spawn and this one changes it into weapon_pain_pills_spawn

The $$ question is do these scripts affect defibs that are auto added by the director.
I am begenning to think they will not.

Getting rid of these DIRECTOR AUTO added defibs (without using a SM plugin) is the challenge that remains...
From my test, I didnt see any defib spawn on map at all, unless your plugins mess with that. I used Vscript for remove specific weapon for long time.
Just in case, Add
Code:
AllowPillConversion = 0
or other way to remove defib is filter by model
Code:
function OnGameEvent_round_start_post_nav( params )
{
	// Keep our model path names here; Can be fetched with the .GetModelName() method for CBaseEntity
	//// For melees, it doesn't remove ones already in a player's inventory, as those are "predicted_viewmodel" entities using the v_* prefix models.
	local ItemstoRemove_ModelPaths =
	[
		"models/w_models/weapons/w_eq_defibrillator.mdl",
		"models/w_models/weapons/w_eq_defibrillator_no_paddles.mdl",

	]
	// automatically grab each index in the array
	foreach( modelpath in ItemstoRemove_ModelPaths )
	{
		local weapon_ent = null
		while( weapon_ent = Entities.FindByModel(weapon_ent, modelpath) )
			weapon_ent.Kill()
	}
}

Last edited by moschinovac; 07-08-2022 at 07:41.
moschinovac is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-08-2022 , 07:27   Re: [L4D2] Stripper help with deleting defibs
Reply With Quote #13

Quote:
Originally Posted by Marttt View Post
Better give more info like which map
Quote:
Originally Posted by Marttt View Post
Could you tell the map and the spot where it occurs?
EDIT: I gave up (check below)
__________________

Last edited by Marttt; 07-08-2022 at 19:37.
Marttt is offline
Austin
Senior Member
Join Date: Oct 2005
Old 07-08-2022 , 17:40   Re: [L4D2] Stripper help with deleting defibs
Reply With Quote #14

Quote:
Originally Posted by moschinovac View Post
From my test, I didnt see any defib spawn on map at all, unless your plugins mess with that. I used Vscript for remove specific weapon for long time.
The map I tested with had a defib placed using Stripper and the vscript definitely does not remove it.
So maybe who knows?
1) defib placed by map creator and compiled into the map will be removed by vscripts?
2) defib added using stripper definitely will not be removed by vscript
(vsripts processing runs THEN stripper processing runs???)

Does anyone know of a map that has an entity of
weapon_defibrillator as part of the compiled map?
Austin 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 02:38.


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