Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin

drop things

by Dr.G · 2009-03-19 · 11 replies · 13067 views · 29 downloads

Read the thread (12 posts)

From the first post

this is how you make e.g. knifes dropable....
rn
rn
#include rn#include rnrn#define PLUGIN "Drop Things"rn#define AUTHOR "Dr.G"rn#define VERSION "1.0"rnrnnew const KNIFES[][] = { "weapon_amerknife", "weapon_spade", "weapon_gerknife" }rnrnpublic plugin_init()rn{rn    register_plugin(PLUGIN, VERSION, AUTHOR)rnrn    for (new i = 0; i < sizeof KNIFES; i++)rn    RegisterHam(Ham_DOD_Item_CanDrop, KNIFES[i], "Enable_Drop")rn}rnrnpublic Enable_Drop(iEnt)rn{rn    SetHamReturnInteger(1) // set to Zero if we wanna block the droprn    return HAM_SUPERCEDErn}

Added later in the thread

dod_dropallweapons.sma Plugin Source 6 KB 29 dl Download Compile

The thread

All 12 posts from 2 people on drop things, kept as they were written.

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
03-19-2009, 03:15 PM #1

this is how you make e.g. knifes dropable....rnrn

#include <amxmodx>rn#include <hamsandwich>rnrn#define PLUGIN "Drop Things"rn#define AUTHOR "Dr.G"rn#define VERSION "1.0"rnrnnew const KNIFES[][] = { "weapon_amerknife", "weapon_spade", "weapon_gerknife" }rnrnpublic plugin_init()rn{rn    register_plugin(PLUGIN, VERSION, AUTHOR)rnrn    for (new i = 0; i < sizeof KNIFES; i++)rn    RegisterHam(Ham_DOD_Item_CanDrop, KNIFES[i], "Enable_Drop")rn}rnrnpublic Enable_Drop(iEnt)rn{rn    SetHamReturnInteger(1) // set to Zero if we wanna block the droprn    return HAM_SUPERCEDErn}
diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-19-2009, 04:28 PM #2

very nice :D

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
03-19-2009, 04:37 PM #3

yea just pretty gay some weapons spawn like ammoboxes... now i can finally make my REAL throw weapons -> All weapons lol

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-19-2009, 05:06 PM #4

yeah i noticed that with the spade and pistols.. there has to be a way to change their models tho..nnbut i also just spent the past 5 minutes or so trying to do such, but their models dont seem to actually want to change.. but i didnt really put much effort into it lol

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
03-19-2009, 06:19 PM #5

lol yea but it should be possible to check(pev) the current ent in the forward and use FM_Setmodel, so it still hold the same data... but i havent tested anything like that yet...

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-19-2009, 08:31 PM #6

know of anyway to force them to drop on death? nni looked at a bunch of cs plugins that do similar things, but they appear to all be creating the 'dropped' entity from scratch :(nnn*edit*nnnm i think i might have found a waynn*edit 2*nnok maybe not haha

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-20-2009, 03:41 AM #7

its late and i need to get to sleep but i just wanted to post this real quick..nna little something i threw together pretty quickly, so its quite sloppy and definitely needs a bit of touching up.. but i wanted to see if it would work in a somewhat decent way by the end of the night.. and in my limited testing (with bots on a local) it appears to work pretty wellnnfeel free to give it a try before i clean it up and bit and do some real testing :Dnnn*edit* ... the attached plugin is VERY buggy lol, especially on linux servers.. but ill be posting a version in the test forum sections soon that works way better

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
03-20-2009, 12:45 PM #8

great man :D! gj but it should be way more simple then touch, think etc. ive tryed to catch the spawn with ham like this:rnrn

RegisterHam(Ham_Spawn ,szClassName, "func_HamSpawn", 1)
rnrnszClassName is "weaponbox".. but i cant find out what the ammo boxes contain..?.. If i could i belive that it would be a better solution cuz its more simple, and faster..rnrnoverall the game itself should/do take care of the ent if its classname is called weaponbox it does e.g in dod_throw_weapons i made..

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-20-2009, 04:51 PM #9

well theres nothing being done with 'weaponbox' entities at all in the plugin..nnnand i did try to use the HamSpawn at first, and to be honest at this point i dont even recall for what, but whatever it was i was trying to catch just happened way to much to be able to tell which ones were the ones i was looking to do something with lol

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
03-20-2009, 05:21 PM #10
well theres nothing being done with 'weaponbox' entities at all in the plugin..rn
rnrnlol no i know. well iam not i can explain what i ment so fuck it, this works lol. however how about nades? :D when you make them dropable you can only drop one and the rest, if you had any, is gone..

diamond-optic
posted here
Posts: 2,068
Threads: 103
Joined: May 2005
03-20-2009, 05:41 PM #11

well once i get around to doing nades, ill worry bout it then hahaha

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
03-20-2009, 05:46 PM #12

great iam off to my sofa again :D...

DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC