PDA

View Full Version : Call Function on slot2


Wilson [29th ID]
07-13-2006, 12:37 PM
I've seen in several plugins the line

register_clcmd("drop", "drop_function")

That will replace either replace drop or be called along with drop (pretty sure the latter). What I'd like to do is the same but this time for slot1, slot2, and slot3.

I'd like slot1, slot2, and slot3 to call their normal functions but also call a function.

Is this possible? Or is slot1 2 and 3 different from "drop"?

If this works I'll have a nice little plugin to drop off here :-D

diamond-optic
07-13-2006, 10:08 PM
well it can replace or add to the drop command.. depends if you use PLUGIN_HANDLED or PLUGIN_CONTINUE i believe...

but anyway i dont understand what ya mean...

if you mean slots as in weapon slots... the primary weapon is the only one that responds to the drop command as far as normal dod goes.. tho you could make it register the cmd on a diff weapon (say pistol) and have that create a the entity on the ground.. but i dont know of anyway to strip just a single weapon from a player...

Wilson [29th ID]
07-14-2006, 06:56 AM
Nono, you misunderstood.

I'm trying to call a function when someone presses slot1, slot2, or slot3

Nothing to do with "drop" - just using that as an example. Do you know how?

Hell Phoenix
07-15-2006, 04:57 PM
I dont know if this is catchable or not...you can try. It would be something like:

register_clcmd("slot1", "slot1func")
register_clcmd("slot2", "slot2func")

etc.

Wilson [29th ID]
07-16-2006, 10:09 PM
yeah that's exactly what i tried and it never calls the functions :( any other methods?