PDA

View Full Version : drop things


Dr.G
03-19-2009, 04:15 PM
this is how you make e.g. knifes dropable....

#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "Drop Things"
#define AUTHOR "Dr.G"
#define VERSION "1.0"

new const KNIFES[][] = { "weapon_amerknife", "weapon_spade", "weapon_gerknife" }

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

for (new i = 0; i < sizeof KNIFES; i++)
RegisterHam(Ham_DOD_Item_CanDrop, KNIFES[i], "Enable_Drop")
}

public Enable_Drop(iEnt)
{
SetHamReturnInteger(1) // set to Zero if we wanna block the drop
return HAM_SUPERCEDE
}

diamond-optic
03-19-2009, 05:28 PM
very nice :D

Dr.G
03-19-2009, 05:37 PM
yea just pretty gay some weapons spawn like ammoboxes... now i can finally make my REAL throw weapons -> All weapons lol

diamond-optic
03-19-2009, 06:06 PM
yeah i noticed that with the spade and pistols.. there has to be a way to change their models tho..

but 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
03-19-2009, 07:19 PM
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
03-19-2009, 09:31 PM
know of anyway to force them to drop on death?

i looked at a bunch of cs plugins that do similar things, but they appear to all be creating the 'dropped' entity from scratch :(


*edit*

nm i think i might have found a way

*edit 2*

ok maybe not haha

diamond-optic
03-20-2009, 04:41 AM
its late and i need to get to sleep but i just wanted to post this real quick..

a 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 well

feel free to give it a try before i clean it up and bit and do some real testing :D


*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
03-20-2009, 01:45 PM
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:

RegisterHam(Ham_Spawn ,szClassName, "func_HamSpawn", 1)

szClassName 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..

overall 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
03-20-2009, 05:51 PM
well theres nothing being done with 'weaponbox' entities at all in the plugin..


and 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
03-20-2009, 06:21 PM
well theres nothing being done with 'weaponbox' entities at all in the plugin..


lol 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
03-20-2009, 06:41 PM
well once i get around to doing nades, ill worry bout it then hahaha

Dr.G
03-20-2009, 06:46 PM
great iam off to my sofa again :D...