AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remove weapons with Ham_RemovePlayerItem (https://forums.alliedmods.net/showthread.php?t=152715)

Mlk27 03-13-2011 05:56

Remove weapons with Ham_RemovePlayerItem
 
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.

schmurgel1983 03-13-2011 11:47

Re: Remove weapons with Ham_RemovePlayerItem
 
try a post hook, not pre hook

Mlk27 03-13-2011 18:44

Re: Remove weapons with Ham_RemovePlayerItem
 
Are you sure? But why I could get the weapons dropped with client_cmd in this hook?

Exolent[jNr] 03-15-2011 09:13

Re: Remove weapons with Ham_RemovePlayerItem
 
Quote:

Originally Posted by schmurgel1983 (Post 1432639)
try a post hook, not pre hook



All times are GMT -4. The time now is 23:40.

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