AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remove weapon dropped by a CERTAIN player (https://forums.alliedmods.net/showthread.php?t=187194)

Backstabnoob 06-10-2012 04:47

Remove weapon dropped by a CERTAIN player
 
Can anyone show me an example of removing a weapon that gets dropped upon death (or with "drop" command but that's blocked anyway) by a certain player (for example, player whose team is CT etc, I don't want all the weapons to be removed)? I tried doing it with FM_SetModel, or something like that though the weapon model has always been 'weaponbox.mdl' and I wasn't successful. I want only to remove a dropped desert eagle.

Thanks.

K.K.Lv 06-10-2012 04:54

Re: Remove weapon dropped by a CERTAIN player
 
if you know a bit C++, you can see CSDM source, native csdm_remove_weapon;
maybe it can help you

Backstabnoob 06-10-2012 08:33

Re: Remove weapon dropped by a CERTAIN player
 
How could that help me?

ConnorMcLeod 06-10-2012 09:39

Re: Remove weapon dropped by a CERTAIN player
 
Hook Ham_Touch with "weaponbox", and check if weaponbox is not on the ground, touching player should be the droping one.

Backstabnoob 06-10-2012 10:01

Re: Remove weapon dropped by a CERTAIN player
 
I'm actually using your plugin ( http://forums.alliedmods.net/showthread.php?p=761924 ) and I figured out the hooks I used before (like FM_SetModel) didn't work because of that. Can you be that kind and show me an example of doing it within your plugin? I don't want Deagle to be dropped.

I tried checking if iWeapon's ID is CSW_DEAGLE and if it was, I'd use 'continue' in the loop, but it was crashing the server.

claudiuhks 06-10-2012 10:33

Re: Remove weapon dropped by a CERTAIN player
 
Try hooking FM_Think through FakeMeta

ConnorMcLeod 06-10-2012 12:42

Re: Remove weapon dropped by a CERTAIN player
 
Your thread is about filtering dropped weapon by player (assuming it is not on death else it makes no sense),
and now you are asking to filter by weapon type and on death.

Alekkkk 06-10-2012 12:50

Re: Remove weapon dropped by a CERTAIN player
 
Why just don't strip that weapon from the player on Ham_Killed ?

Backstabnoob 06-10-2012 13:35

Re: Remove weapon dropped by a CERTAIN player
 
@Connor:
Quote:

removing a weapon that gets dropped upon death
I use your plugin, so all the weapons get dropped on death. However, I want Desert Eagle to be deleted when a player dies, so he doesn't drop it.

@Alekkkk: Thank you, it works. Don't know why I didn't think about it before O.o

ConnorMcLeod 06-10-2012 13:51

Re: Remove weapon dropped by a CERTAIN player
 
Quote:

Originally Posted by Backstabnoob (Post 1726242)
@Alekkkk: Thank you, it works. Don't know why I didn't think about it before O.o

Because you said you don't want to strip all weapons ? (don't strip c4 if your server is playing with bomb objectives ;) )


All times are GMT -4. The time now is 06:10.

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