Raised This Month: $51 Target: $400
 12% 

[L4D2] Weapon Drop


Post New Thread Reply   
 
Thread Tools Display Modes
Electr000999
Senior Member
Join Date: Aug 2011
Old 01-22-2016 , 15:36   Re: [L4D2] Weapon Drop
Reply With Quote #51

  1. Fixed bug with copy throwable item after throw and drop by bind (pipes and molly or bile).
  2. Realised in new syntax.
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_drop.sp - 631 views - 5.0 KB)

Last edited by Electr000999; 01-22-2016 at 15:48.
Electr000999 is offline
Send a message via Skype™ to Electr000999
Pyc
Senior Member
Join Date: Jan 2014
Old 03-29-2016 , 16:21   Re: [L4D2] Weapon Drop
Reply With Quote #52

Quote:
Originally Posted by Electr000999 View Post
  1. Fixed bug with copy throwable item after throw and drop by bind (pipes and molly or bile).
  2. Realised in new syntax.
with your fix players can't drop 2nd slot!
Pyc is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 03-30-2016 , 15:19   Re: [L4D2] Weapon Drop
Reply With Quote #53

Quote:
Originally Posted by Pyc View Post
with your fix players can't drop 2nd slot!
by second slot you mean pistol or melee weapon slot correct? by design it does this because if you do drop that slot you will be defenseless unless you have a primary, but you'll still be defenseless while incap, it's simple to change, my dropmod version has all slots(even unused slots) able to be dropped...because i use my own addons to change weapon and item slots, so i can carry a melee weapon and pistols at the same time, so I allowed myself to be able to drop either or...The way they set up dropmod was done basically to avoid problems.

Last edited by MasterMind420; 03-30-2016 at 15:21.
MasterMind420 is offline
Pyc
Senior Member
Join Date: Jan 2014
Old 03-31-2016 , 07:04   Re: [L4D2] Weapon Drop
Reply With Quote #54

Quote:
Originally Posted by MasterMind420 View Post
by second slot you mean pistol or melee weapon slot correct? by design it does this because if you do drop that slot you will be defenseless unless you have a primary, but you'll still be defenseless while incap, it's simple to change, my dropmod version has all slots(even unused slots) able to be dropped...because i use my own addons to change weapon and item slots, so i can carry a melee weapon and pistols at the same time, so I allowed myself to be able to drop either or...The way they set up dropmod was done basically to avoid problems.
correct, I mean pistol and melee
drop this guns very need for me

Last edited by Pyc; 03-31-2016 at 07:04.
Pyc is offline
Pyc
Senior Member
Join Date: Jan 2014
Old 03-31-2016 , 08:25   Re: [L4D2] Weapon Drop
Reply With Quote #55

for enable drop 2nd slot I change line 154
from
Code:
        if (weapon > 0 && IsValidEntity(weapon) && slot != 1))
to
Code:
        if (weapon > 0 && IsValidEntity(weapon))
Pyc is offline
Pyc
Senior Member
Join Date: Jan 2014
Old 05-15-2016 , 06:09   Re: [L4D2] Weapon Drop
Reply With Quote #56

based on electro version (small code edit)
- added drop on 2nd slot (pistol, melee)
- 1, 2, 4, 5 slots can drop quickly (ex. if I change from 1 slot to 2 and quickly press drop, choosed item dropped). not for 3rd slot for fix spam grenades
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_drop.sp - 638 views - 5.2 KB)
Pyc is offline
alcybery
Member
Join Date: Apr 2016
Old 04-02-2017 , 23:53   Re: [L4D2] Weapon Drop
Reply With Quote #57

Is there a way to bind dropping to a key? I saw this done on some server with Shift+R.

Maybe something like this?
PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if( 
buttons IN_RELOAD && buttons IN_SPEED )
        
PrintToChat(client"Pressed");
        
//Code for actually dropping an item should probably go here
    
return Plugin_Continue;

It prints the test message, but I'm new to SM so I don't know how to do the code for the actual drop.

Last edited by alcybery; 04-02-2017 at 23:56.
alcybery is offline
Uncle Jessie
Member
Join Date: May 2016
Location: Mind Prison
Old 04-03-2017 , 13:07   Re: [L4D2] Weapon Drop
Reply With Quote #58

Quote:
Originally Posted by alcybery View Post
Is there a way to bind dropping to a key? I saw this done on some server with Shift+R.

Maybe something like this?
PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if( 
buttons IN_RELOAD && buttons IN_SPEED )
        
PrintToChat(client"Pressed");
        
//Code for actually dropping an item should probably go here
    
return Plugin_Continue;

It prints the test message, but I'm new to SM so I don't know how to do the code for the actual drop.
Try

Update:
Added Shift+E version - l4d2_drop_E
Edited Shift+R version - l4d2_drop_R
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_drop_E.sp - 424 views - 5.9 KB)
File Type: sp Get Plugin or Get Source (l4d2_drop_R.sp - 380 views - 5.3 KB)

Last edited by Uncle Jessie; 02-04-2018 at 09:41.
Uncle Jessie is offline
alcybery
Member
Join Date: Apr 2016
Old 04-03-2017 , 13:40   Re: [L4D2] Weapon Drop
Reply With Quote #59

Quote:
Originally Posted by Uncle Jessie View Post
Try
Works great. Thanks a lot!
alcybery is offline
Uncle Jessie
Member
Join Date: May 2016
Location: Mind Prison
Old 04-04-2017 , 10:41   Re: [L4D2] Weapon Drop
Reply With Quote #60

Quote:
Originally Posted by alcybery View Post
Works great. Thanks a lot!
These lines are not needed for IN_RELOAD button, only for IN_USE which I use.
PHP Code:
buttons &= ~IN_RELOAD
Also you can make the delay less.
PHP Code:
CreateTimer(1.0ResetDelayclient); 

Last edited by Uncle Jessie; 11-29-2017 at 09:25.
Uncle Jessie 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 08:26.


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