AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Solved ] Ham_CS_Item_CanDrop question (https://forums.alliedmods.net/showthread.php?t=87991)

TheRadiance 03-19-2009 03:39

[ Solved ] Ham_CS_Item_CanDrop question
 
Hi :)

subj:

I have a question about Ham_CS_Item_CanDrop. Can it force a player to drop a current item (weapon)?
Example: player has m4a1 (active), and i want him to drop it.

And if not so hard, can you show me an example of usage it. I tried ExecuteHam and ExecuteHamB, but it doesn't work, because i don't know how to use it.

I read ham_const, but didn't understand well.

Thanks.

jim_yang 03-19-2009 04:24

Re: Ham_CS_Item_CanDrop question
 
no, it can't.
cs use
Code:

void CBasePlayer::DropPlayerItem ( char *pszItemName )
to force a player drop some item
you can use engclient_cmd(id, "drop")

TheRadiance 03-19-2009 04:31

Re: Ham_CS_Item_CanDrop question
 
Quote:

Originally Posted by jim_yang (Post 784228)
no, it can't.
cs use
Code:

void CBasePlayer::DropPlayerItem ( char *pszItemName )
to force a player drop some item
you can use engclient_cmd(id, "drop")

ok, thanks.
One more question:
Can i force a player to drop knife or grenade? - i tried engclient_cmd in this case, but it didn't help me. Is there any another way to do it?

jim_yang 03-19-2009 04:55

Re: Ham_CS_Item_CanDrop question
 
there is a tut about strip user's weapon but not drop. you have to simulate the drop effect yourself

TheRadiance 03-19-2009 05:03

Re: Ham_CS_Item_CanDrop question
 
Quote:

Originally Posted by jim_yang (Post 784245)
there is a tut about strip user's weapon but not drop. you have to simulate the drop effect yourself

Ok, Thanks anyway.
Solved.

ConnorMcLeod 03-19-2009 08:29

Re: [ Solved ] Ham_CS_Item_CanDrop question
 
You could use engclient_cmd with nades but then you would have to hook Ham_CS_Item_CanDrop, return true and supercede.

See http://forums.alliedmods.net/showpos...1&postcount=27

TheRadiance 03-19-2009 08:36

Re: [ Solved ] Ham_CS_Item_CanDrop question
 
Quote:

Originally Posted by ConnorMcLeod (Post 784337)
You could use engclient_cmd with nades but then you would have to hook Ham_CS_Item_CanDrop, return true and supercede.

See http://forums.alliedmods.net/showpos...1&postcount=27

OMG, thank ver much!


All times are GMT -4. The time now is 09:00.

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