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

[l4d2] Save Weapon (Co-op)


Post New Thread Reply   
 
Thread Tools Display Modes
Pyc
Senior Member
Join Date: Jan 2014
Old 03-12-2016 , 16:43   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #41

hp saving only for bots, not for players (fork 4.1)
if I type !afk, my bot can change weapon
if I don't move and join to spec automatically, my weapons saved

Last edited by Pyc; 03-12-2016 at 16:44.
Pyc is offline
maks
Member
Join Date: Dec 2011
Location: Russia
Old 03-15-2016 , 10:11   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #42

Updated v3.7.1
maks is offline
Accelerator
Senior Member
Join Date: Dec 2010
Location: Russia
Old 03-16-2016 , 03:32   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #43

Code:
public int TyGetSlot1(int &client, int iSlot1)
{
	sg_modelName[0] = '\0';
	sg_slot1[client][0] = '\0';
	GetEntPropString(iSlot1, Prop_Data, "m_ModelName", sg_modelName, sizeof(sg_modelName)-1);

	if (StrEqual(sg_modelName, "models/v_models/v_dual_pistolA.mdl", false))
	{
		sg_slot1[client] = "dual_pistol";
		return 1;
	}
	else
	{
		GetEdictClassname(iSlot1, sg_slot1[client], 39);
		if (StrEqual(sg_slot1[client], "weapon_melee"))
		{
			GetEntPropString(iSlot1, Prop_Data, "m_strMapSetScriptName", sg_slot1[client], 39);
			return 1;
		}
		if (StrEqual(sg_slot1[client], "weapon_chainsaw"))
		{
			ig_iClip1_saw[client] = GetEntProp(iSlot1, Prop_Send, "m_iClip1", 4);
			sg_slot1[client] = "chainsaw";
			return 1;
		}
		if (sg_slot1[client][0] != '\0')
		{
			return 1;
		}
	}

	LogError("m_ModelName(%s) %s", sg_modelName, sg_slot1[client]);
	LogError("___________");
	return 0;
}

Last edited by Accelerator; 03-16-2016 at 04:27.
Accelerator is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 03-17-2016 , 18:21   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #44

Save Weapon 4.3 (forked)

Based on maks Save Weapon 3.6.7 and Electr000999's fork.

Description:
On coop/realism servers with 5+ survivors, the game will not save anything related to the extra survivors. Hence these survivors will start every new map of a campaign with 100 health and no equipment, or will end up with the equipment of a different survivor. With the plugin, the equipment of all survivors will be properly saved.

New to 4.3:
- l4d2_ty_noob now gives you a smg at the start of the first map if you don't have one
- Improved precaching of a few weapons
- Dual pistols detection doesn't use model anymore

New to 4.2:
- Fixed bug where going idle could change your weapons

New to 4.1:
- Plugin properly saves temporary HP, ReviveCount, and Black&White status

New Features of the Fork:
- Plugin now saves bot equipment! Bots will come back with the same gear they had the previous mission.
- Plugin saves health for survivors. Dead survivors will come back with 50 health on the next map.
- Plugin saves prop data & models. That means if you have 5 players and 2 bots (say, 1 Rochelle and 1 Francis), the same bots will come back on subsequent missions (Character Select Menu/FakeZoey recommended)
- When a survivor bot is replaced by a player, that player with inherit the saved equipment of the bot. The same will happen if a player is replaced by a bot
- Plugin only enabled on modes "coop", "realism", and related mutations. It is automatically disabled on other modes.

Cvars:
- l4d2_ty_noob: If 1, gives SMG after spawning (Default: 0)
- l4d2_ty_clear_after_campaign: If 1, clear weapons after end/change of campaign. (Default: 1)

Commands:
- !save_weap_all: Save the weapons & health of every survivor. Admin only
- !load_weap_all: Load the saved weapons & health of every survivor. Admin only
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_ty_saveweapon.sp - 8698 views - 28.4 KB)
__________________

Last edited by Merudo; 04-06-2016 at 13:21.
Merudo is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 03-17-2016 , 18:24   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #45

Quote:
Originally Posted by Pyc View Post
hp saving only for bots, not for players (fork 4.1)
if I type !afk, my bot can change weapon
if I don't move and join to spec automatically, my weapons saved
I fixed the !afk bug in this version.

Hopefully that fixed the hp bug as well, but please do tell me if you encounter it again.
__________________
Merudo is offline
maks
Member
Join Date: Dec 2011
Location: Russia
Old 03-20-2016 , 07:04   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #46

Updated v3.7.6
maks is offline
Emilio3
Member
Join Date: Aug 2013
Location: London UK
Old 03-22-2016 , 12:34   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #47

when i use !afk not save the weapons
use !join and not weapons
can you fix this please v 3.7.6
Emilio3 is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 03-22-2016 , 14:43   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #48

Hi Emilio. Have you tried my version? It should work fine.
__________________
Merudo is offline
Emilio3
Member
Join Date: Aug 2013
Location: London UK
Old 03-23-2016 , 03:14   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #49

ok i try. the problem is when you take afk and coming again to join. not save the weapons. i tell you if working ok. thanks Nerudo
Emilio3 is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 03-23-2016 , 09:12   Re: [l4d2] Save Weapon (Co-op)
Reply With Quote #50

Sorry I'm not sure if I understand correctly? What's the problem with !afk, exactly?

Using you use !save_weap_all or something, the plugin only saves weapons at the end of the map. So !afk should not do anything there, unless you finish the level while still afk.

Also !afk is a command from a different plugin, which one exactly are you using?
__________________

Last edited by Merudo; 03-23-2016 at 09:14.
Merudo 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 03:46.


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