Raised This Month: $32 Target: $400
 8% 

[REQ][L4D] Drop weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LTR.2
Veteran Member
Join Date: Aug 2009
Old 09-16-2009 , 15:36   [REQ][L4D] Drop weapons
Reply With Quote #1

hi, i was thinking on a plugin that allows you to drop your primary weapon and second pistol, medkit and explosives whenever you want. with a specific key.

Possible? =D
LTR.2 is offline
olj
Veteran Member
Join Date: Jun 2009
Old 09-16-2009 , 19:58   Re: [REQ][L4D] Drop weapons
Reply With Quote #2

I think so. But should rather use a chat trigger - all commands are bound for living survivors, no free button which can be used for that. My suggestion is to get survivor's active weapon slot, fakeclient command give that weapon, then remove weapon from survivor.

A few problems however - i doubt you can drop pistol (but we can try), and i dont know how to set ammo in dropped weapon.
__________________
olj is offline
LTR.2
Veteran Member
Join Date: Aug 2009
Old 09-17-2009 , 12:02   Re: [REQ][L4D] Drop weapons
Reply With Quote #3

the ammo in droped weapon it's not big deal. but i was suggesting this instead of just give to toher players ammo packs. something tnat it's impossible to do cuz ammo packs doesn't exist =P

so instead of passing ammo, pass the weapon.
LTR.2 is offline
olj
Veteran Member
Join Date: Jun 2009
Old 09-19-2009 , 04:49   Re: [REQ][L4D] Drop weapons
Reply With Quote #4

Quote:
Originally Posted by LTR.2 View Post
the ammo in droped weapon it's not big deal

so instead of passing ammo, pass the weapon.
It is, since if you "drop" and then pickup weapon you will replenish your ammo (WE CREATE NEW WEAPON, dont forget about it) . So, we need to get around this first.

Oh well - i think we can "remember" the current ammo of player BEFORE he "drop" weapon.

But this way we also need to hook if he is picking up "dropped" weapon again - that can be abit tricky, we can use GetClientAimTarget + hooking IN_USE to help with it.

But how the hell we determine if weapon he picking up is the one he dropped?? "give" command dont have index property. Maybe just plain entity spawn should work, but im not too good at spawning something from code.

Can someone give example of spawning pickable weapon?
__________________

Last edited by olj; 09-19-2009 at 04:58.
olj is offline
LTR.2
Veteran Member
Join Date: Aug 2009
Old 09-19-2009 , 09:52   Re: [REQ][L4D] Drop weapons
Reply With Quote #5

Quote:
Originally Posted by olj View Post
But how the hell we determine if weapon he picking up is the one he dropped??
because the weapon falls on his feets?
LTR.2 is offline
Frus
Senior Member
Join Date: Aug 2009
Old 09-19-2009 , 15:51   Re: [REQ][L4D] Drop weapons
Reply With Quote #6

Quote:
Originally Posted by olj View Post
Can someone give example of spawning pickable weapon?
I do it in my comp plugin (to force somebody to drop a weapon if they pick one up in pause mode). (EDIT: I do use the give command, but only because I was too lazy to find all the models for every weapon in the game.)

I'll see what I can do for this request.
Frus is offline
Frus
Senior Member
Join Date: Aug 2009
Old 09-19-2009 , 16:41   Re: [REQ][L4D] Drop weapons
Reply With Quote #7

Here you go, I tested it a bit. Seems to work fine. uses sm_drop so type !drop in chat.
Attached Files
File Type: sp Get Plugin or Get Source (l4ddrop.sp - 627 views - 3.4 KB)
Frus is offline
LTR.2
Veteran Member
Join Date: Aug 2009
Old 09-19-2009 , 18:00   Re: [REQ][L4D] Drop weapons
Reply With Quote #8

let's see.
LTR.2 is offline
LTR.2
Veteran Member
Join Date: Aug 2009
Old 09-19-2009 , 19:02   Re: [REQ][L4D] Drop weapons
Reply With Quote #9

well, it's good. but it's annoying have to write !drop everytime.
i can bind a key to say it of course, but it's still annoying to flood the chat.
what it's the cvar for that? so i can bind a key to attach it.

PD:
other idea: if i want the bots to drop a gun, i can say something like "louis drop" like saying to another teammate to drop that gun.

PD2: still saying that drop ammo would be more useful =D
LTR.2 is offline
Frus
Senior Member
Join Date: Aug 2009
Old 09-19-2009 , 19:07   Re: [REQ][L4D] Drop weapons
Reply With Quote #10

Quote:
Originally Posted by LTR.2 View Post
well, it's good. but it's annoying have to write !drop everytime.
i can bind a key to say it of course, but it's still annoying to flood the chat.
what it's the cvar for that? so i can bind a key to attach it.

PD:
other idea: if i want the bots to drop a gun, i can say something like "louis drop" like saying to another teammate to drop that gun.

PD2: still saying that drop ammo would be more useful =D
It's not a cvar, it's a concommand, and it's sm_drop. It doesn't matter whether you bind something to sm_drop, type it in console, or type !sm_drop or !drop in chat.

You can use the fake client execute plugin if you want to force other players like bots to execute commands (like sm_drop)

http://forums.alliedmods.net/showthread.php?p=630439
Frus is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:11.


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