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

[L4D2] Track melee weapon entities between map changes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Old 12-15-2019 , 06:50   [L4D2] Track melee weapon entities between map changes
Reply With Quote #1

I would like to track melee weapon entities (taken by players and left on ground) between map changes. I need to store "m_flModelScale" at the end of a map and restore them when the next map starts. Changing m_flModelScale to a value greater than 1 gives you an giant version of the melee weapon. I use "HookUserMessage(GetUserMessageId("ShowStats" ), UM_ShowStats, false)" to track store these value.

My questions are:
1. Is there any method to uniquely identify entities when the map changes
2. Which event should I listen to? (So that I can know when these entities are created)

Thanks in advance!
__________________
rikka0w0 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-15-2019 , 07:36   Re: [L4D2] Track melee weapon entities between map changes
Reply With Quote #2

The game just stores the angles and origin iirc for melee weapons and model ect.
My guess is just check angles and origin for a match, anyweapons saved in midair will fall you may wanna do it very early in a "SDKHooks_Spawn" hook or something.


EDIT:
I forgot to mention the origin in transition can change but is always in the same spot in safearea box, don't remember how to get that volume i think it's "info_landmark" stored in that entity.

maybe help you
https://developer.valvesoftware.com/...gn/Checkpoints
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D

Last edited by Lux; 12-15-2019 at 07:55.
Lux is offline
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Old 12-15-2019 , 08:09   Re: [L4D2] Track melee weapon entities between map changes
Reply With Quote #3

Is there any way to determine who is carrying the weapon_melee entity?

For example, I have the "int entityID" but I want to find out who (int clientID) is carrying it.

Thanks!
__________________
rikka0w0 is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 12-15-2019 , 08:13   Re: [L4D2] Track melee weapon entities between map changes
Reply With Quote #4

You can get the owner

PHP Code:
int iClient GetEntPropEnt(entityProp_Send"m_hOwnerEntity");
if(
iClient 1)//if weapon has no owner return
    
return; 
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 12-18-2019 , 11:02   Re: [L4D2] Track melee weapon entities between map changes
Reply With Quote #5

found this code may help for your script https://forums.alliedmods.net/showthread.php?t=290644
foxhound27 is offline
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Old 12-29-2019 , 14:31   Re: [L4D2] Track melee weapon entities between map changes
Reply With Quote #6

Hi all,

I wrote a plugin to track the model size of melee weapons (carried by players).
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_keep_model_scale.sp - 181 views - 3.1 KB)
File Type: smx l4d2_keep_model_scale.smx (5.9 KB, 60 views)
__________________
rikka0w0 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 13:32.


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