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

Real Weapon Drop


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Emp` (115)
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 05-01-2008 , 13:00   Real Weapon Drop
Reply With Quote #1

Description:
This plugin introduces into the game more features related to dropped weapons. Features such as:
  1. Ability to drop weapons up and down - where you aim, in that direction weapon will be thrown.
  2. Ability to manually drop grenades.
  3. Drop all weapons at death. Including grenades and a special box of ammunition.
  4. Drop all weapons on disconnect. Including grenades and a special box of ammunition.
  5. Barrel of dropped weapons is always facing in the same direction as player was looking.

Requires:
FakeMeta
HamSandWich


Cvars:

* "rwd_aimdrop" - Counter-Strike:Source style manual weapon drop.
- "1" - enabled. [default]
- "0" - disabled.

* "rwd_grenadedrop" - ability to manually drop grenades.
- "1" - enabled. [default]
- "0" - disabled.

* "rwd_deathdrop" - drop all weapons on death.
- "1" - enabled. [default]
- "0" - disabled.

* "rwd_disconnectdrop" - drop all weapons on disconnect.
- "1" - enabled. [default]
- "0" - disabled.

* "rwd_modelanglefix" - barrel of the weapon angle fix.
- "1" - enabled. [default]
- "0" - disabled.


Additional info:
Tested in Counter-Strike 1.6 with amxmodx 1.8.2. Various features can be enabled and disabled via cvars. This plugin also has support VIP objectives and grenade trail plugins.


Notes:
Barrel of dropped weapons may be facing in wrong direction if client is using custom weapon models.


Warnings:
In some cases pausing this plugin may lead to glitches, therefor if when needed please use cvars instead. That is if paused in certain moments by other plugins. Manual pauses won't do much harm, except dropped flashes will fill up your flashbang slot to maximum, and ammunition box will be touchable only once.


Credits:
Special thanks to Arkshine for Counter-Strike SDK and big help what he have provided by delivering very useful information! Also big thanks goes to eDark for calculation functions!


Change-Log:

* 2.3
- Fixed: Crash at mapchange if there's too many players and other entities.
- Changed: More reliability when saving number of dropped bullets and flash grenades.

* 2.1
- Changed: Minor performance improvement.

* 2.0
- Fixed: Grenades do not bounce insane when dropped.
- Fixed: VIPs can't no longer pick-up ammunition.
- Fixed: VIPs also do drop their weapons if have any.
- Changed: Full plugin rewrite - plugin is now much more stable.

* 1.4
- Fixed: "grenade bounce for ever" by adding gravitation level manually.

* 1.3
- Fixed: Explode grenade on death if it's not armed.
- Added: Grenade drop.

* 1.2
- Fixed: Due to bug in standard ArrayDeleteItem(Array:which, item) native I created my own working one.

* 1.1
- Changed: (code) Modified array clear (less cpu usage - I think).
- Changed: (code) Entity scan (less cpu usage).
- Changed: (code) Unneeded data getting from array - removed (less cpu usage).

* 1.0
- First release.
Attached Files
File Type: sma Get Plugin or Get Source (real_weapon_drop.sma - 5757 views - 32.5 KB)
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 02-04-2014 at 15:39.
MPNumB is offline
Send a message via Skype™ to MPNumB
bigbud
Member
Join Date: Jan 2008
Old 05-01-2008 , 17:56   Re: Real Weapon Drop
Reply With Quote #2

Again a nice Work...

+karma
bigbud is offline
Seker
Junior Member
Join Date: Dec 2007
Old 05-01-2008 , 19:44   Re: Real Weapon Drop
Reply With Quote #3

will try it out

+karma ;)
Seker is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 05-01-2008 , 21:15   Re: Real Weapon Drop
Reply With Quote #4

Omg.

Amazing.
BOYSplayCS is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-01-2008 , 22:30   Re: Real Weapon Drop
Reply With Quote #5

Code:
parse(buffer, s_ent, 4, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0);
// ->
parse(buffer, s_ent, 4);
Code:
	while( (ent=engfunc(EngFunc_FindEntityByString, ent, "classname", "weaponbox"))>0 )
	{
		if( ent>0 )
//you already check if the ent is >0 in the while loop
Code:
		classname = "";
// ->
		copy(classname, 1, "");
//poor way to clear an array
Code:
set_task(0.01,
//this just rounds down to 0.0, but look at next comment
don't see a point in modify_death_speed(weaponbox_ent) because you already set the velocity in weaponbox_spawned(weaponbox_ent, owner) so it really isn't doing anything
Code:
				buffer = "";
//same as other comment with clearing array
Approval with changes and confirmation that it works.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 05-02-2008 , 03:33   Re: Real Weapon Drop
Reply With Quote #6

Nice Plugin.

NOTE : The plugin works fine
__________________
atomen is offline
Send a message via MSN to atomen
BloodMan
Senior Member
Join Date: Apr 2008
Location: Lithuania
Old 05-02-2008 , 04:37   Re: Real Weapon Drop
Reply With Quote #7

Good Job.
__________________
BloodMan is offline
Send a message via Skype™ to BloodMan
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 05-02-2008 , 06:05   Re: Real Weapon Drop
Reply With Quote #8

Quote:
Originally Posted by Emp` View Post
Code:
parse(buffer, s_ent, 4, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0, "", 0);
// ->
parse(buffer, s_ent, 4);
Code:
	while( (ent=engfunc(EngFunc_FindEntityByString, ent, "classname", "weaponbox"))>0 )
	{
		if( ent>0 )
//you already check if the ent is >0 in the while loop
Code:
		classname = "";
// ->
		copy(classname, 1, "");
//poor way to clear an array
Code:
set_task(0.01,
//this just rounds down to 0.0, but look at next comment
don't see a point in modify_death_speed(weaponbox_ent) because you already set the velocity in weaponbox_spawned(weaponbox_ent, owner) so it really isn't doing anything
Code:
				buffer = "";
//same as other comment with clearing array
Approval with changes and confirmation that it works.
1. Agree, but didn't know, that it's poss. =P
2. If there are no weaponbox'es that while will be true, but only once (first check), that's why I'm checking it twice.
3. Kk, will change array clear, but just quiruous - what's the diffrence?
4. Set task 0.01 - exucates task in next frame (if 100 fps). Kz_jump_plugin uses the same set_task time to remove duck when teleported. Example: c4 exploaded - predeath - player speed is low speed. Delay - modifyes speed to explotion speed, what can be much bigger.

But ok. I'll make all that, butwont change delay, cuz i'm 100% sure, that it works. I was impressed finding that out two, but belive me - it makes a delay even with 0.0 will make 1 frame delay.

// edit:

Updated to 1.1 :
Changed: (code) modifyed array clear (less cpu usage - I think).
Changed: (code) entity scan (less cpu usage).
Changed: (code) unneded data getting from array - removed (less cpu usage).
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 05-02-2008 at 07:56.
MPNumB is offline
Send a message via Skype™ to MPNumB
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-02-2008 , 07:25   Re: Real Weapon Drop
Reply With Quote #9

I read somewhere that the best way to clear a string is to set the first character to ^0.
Example:

Code:
static sString[32]; sString[0] ='^0';
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 05-02-2008 , 07:28   Re: Real Weapon Drop
Reply With Quote #10

Quote:
Originally Posted by X-olent View Post
I read somewhere that the best way to clear a string is to set the first character to ^0.
Example:

Code:
static sString[32]; sString[0] ='^0';
and then:
Code:
client_print(0, print_chat, sString[1]);


In other words it clears only first symbol. But if print will start from it - it wont print nothing. And isn't it 0x00 or just 0?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Reply


Thread Tools
Display Modes

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 03:15.


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