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

Renaming weapon entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-10-2010 , 16:44   Renaming weapon entity
Reply With Quote #1

Is it possible to rename a weapon entity? So if I give the player a "weapon_knife", but rename it "weapon_blade" then when a player is killed with the renamed weapon_knife then player_death will fire with "weapon_blade" as the weapon?


I already know how to hook player_death and change it myself, I'm just wondering if theres a way to do what I'm asking. I know of work-arounds.
__________________
Greyscale is offline
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Old 07-10-2010 , 17:26   Re: Renaming weapon entity
Reply With Quote #2

Not sure with regular weapons.

This works though:
I spawned a skull, and did

PHP Code:
DispatchKeyValue(ent"classname""weapon_skull"); 
and when the skull explodes, it is correctly registered as a 'weapon_skull' in stats when it kills a player.
__________________
Plugins | TheVille
Zombie Mod for DoD:S - l4dod.theville.org
strontiumdog is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-10-2010 , 17:48   Re: Renaming weapon entity
Reply With Quote #3

Thanks strontiumdog, I will give that a try. Seems so obvious I should have thought of that. Looks promising.
__________________
Greyscale is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 07-10-2010 , 19:22   Re: Renaming weapon entity
Reply With Quote #4

i'm not sure but it may cause issues, i used the same method for my homing missile plugin and 1 person said his server crashed every time the kill icon was supposed to be displayed so i removed it. also if there is no icon for the weapon used you just get the skull and crossbones.
blodia is offline
strontiumdog
Veteran Member
Join Date: Jan 2007
Location: BC, Canada
Old 07-10-2010 , 21:53   Re: Renaming weapon entity
Reply With Quote #5

It might not be possible to rename it:
http://forums.alliedmods.net/showpos...63&postcount=2
__________________
Plugins | TheVille
Zombie Mod for DoD:S - l4dod.theville.org
strontiumdog is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-10-2010 , 21:53   Re: Renaming weapon entity
Reply With Quote #6

I want the skull and crossbones so that isn't a problem. Hopefully it doesn't crash though.
__________________
Greyscale 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 18:48.


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