Raised This Month: $32 Target: $400
 8% 

Solved Drop knife on death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 10-31-2016 , 19:26   Drop knife on death
Reply With Quote #1

I want add to my mod If player die so drop own knife and killer can take player custom knife
I was try with this code in player_death event as well in player_death Pre but no work pls any ideas?
PHP Code:
    char sName[32];
    
int weaponh GetEntPropEnt(victimProp_Send"m_hActiveWeapon");
    
GetEdictClassname(weaponhsNamesizeof(sName));
    if((
StrContains(sName"knife"false) != -1) || (StrContains(sName"bayonet"false) != -1))
    {
        
SDKHooks_DropWeapon(victimweaponh);
    } 

Last edited by _GamerX; 11-13-2016 at 07:54.
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-01-2016 , 04:49   Re: Drop knife on death
Reply With Quote #2

Events occur after the server has processed all it's actions.

I would hook TakeDamage_Alive via SDK Hooks and detect a killshot and drop the knife before the player actually dies.
__________________
Neuro Toxin is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 11-01-2016 , 05:16   Re: Drop knife on death
Reply With Quote #3

Solved i was take some code from this https://forums.alliedmods.net/showth...ht=drop+weapon
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Reply


Thread Tools
Display Modes

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 15:26.


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