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

Remove weapons with Ham_RemovePlayerItem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 03-13-2011 , 05:56   Remove weapons with Ham_RemovePlayerItem
Reply With Quote #1

Could someone point me out why Ham_RemovePlayerItem doesn't work in this piece of code? And that engclient_cmd too, I couldn't figure out why it doesn't work so I commented out the lines.

PHP Code:
RegisterHam(Ham_AddPlayerItem"player""Player_AddPlayerItem")
public 
Player_AddPlayerItem(clientWeapIndex)
{
    if (
ExecuteHam(Ham_Item_ItemSlotWeapIndex) == SLOT_PRIMARY)
    {
        
// new szClassname[16]
        // pev(WeapIndex, pev_classname, szClassname, charsmax(szClassname))
        
        //engclient_cmd(client, "drop", szClassname)
        
ExecuteHam(Ham_RemovePlayerItemclientWeapIndex)
    }

    return 
HAM_IGNORED

Note: Reason why I don't block it with HAM_SUPERCEDE is because I want players to drop the weapons so other players could pick it up.

Last edited by Mlk27; 03-13-2011 at 08:58.
Mlk27 is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 03-13-2011 , 11:47   Re: Remove weapons with Ham_RemovePlayerItem
Reply With Quote #2

try a post hook, not pre hook
__________________

Working on:
nothing
schmurgel1983 is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 03-13-2011 , 18:44   Re: Remove weapons with Ham_RemovePlayerItem
Reply With Quote #3

Are you sure? But why I could get the weapons dropped with client_cmd in this hook?
Mlk27 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-15-2011 , 09:13   Re: Remove weapons with Ham_RemovePlayerItem
Reply With Quote #4

Quote:
Originally Posted by schmurgel1983 View Post
try a post hook, not pre hook
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 11:34.


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