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

Drop All Weapons On Death (14 jul 2013)


Post New Thread Reply   
 
Thread Tools Display Modes
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-19-2009 , 19:38   Re: Drop All Weapons On Death
Reply With Quote #21

You are not using:
PHP Code:
#define    NADES 
Your way is more flexible but, to optimize the plugin i would change:

PHP Code:
for(new i=1i<=CSW_P90 && !(DONT_DROP_WEAPONS i); i++) 
to:
PHP Code:
for(new i=1i<CSW_C4i++)
for(new 
i=CSW_C4+1i<CSW_KNIFEi++)
for(new 
i=CSW_KNIFE+1i<CSW_P90i++) 
__________________
joaquimandrade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-20-2009 , 00:18   Re: Drop All Weapons On Death
Reply With Quote #22

I just have rewritten this part.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-20-2009 at 02:07.
ConnorMcLeod is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-20-2009 , 05:17   Re: Drop All Weapons On Death
Reply With Quote #23

Quote:
Originally Posted by ConnorMcLeod View Post
I just have rewritten this part.
It's nice now. Useful plugin. You are forcing me to learn get_pdata_cbase
__________________
joaquimandrade is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 02-20-2009 , 09:05   Re: Drop All Weapons On Death
Reply With Quote #24

Annything new with drop weapons on disconnect ?
Costin83 is offline
Send a message via Yahoo to Costin83
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 02-20-2009 , 15:35   Re: Drop All Weapons On Death
Reply With Quote #25

Quote:
Originally Posted by BOYSplayCS View Post
That is irrelevant to this plugin.
But when this part will be added, this would be a good replacment of real nade drop.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-20-2009 , 16:04   Re: Drop All Weapons On Death
Reply With Quote #26

Quote:
Originally Posted by Sn!ff3r View Post
But when this part will be added, this would be a good replacment of real nade drop.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Drop Nades"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_CS_Item_CanDrop"weapon_hegrenade""Enable_Drop")
    
RegisterHam(Ham_CS_Item_CanDrop"weapon_flashbang""Enable_Drop")
    
RegisterHam(Ham_CS_Item_CanDrop"weapon_smokegrenade""Enable_Drop")
    
RegisterHam(Ham_CS_Item_CanDrop"weapon_c4""Disable_Drop")
}

public 
Enable_DropiEnt )
{
    
SetHamReturnInteger(1)
    return 
HAM_SUPERCEDE
}

public 
Disable_DropiEnt )
{
    
SetHamReturnInteger(0)
    return 
HAM_SUPERCEDE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 02-21-2009 , 09:35   Re: Drop All Weapons On Death
Reply With Quote #27

What's with:
Code:
RegisterHam(Ham_CS_Item_CanDrop, "weapon_c4", "Disable_Drop") ?
 
 
public Disable_Drop( iEnt )
{
SetHamReturnInteger(0) - zero :shock: ?
  return HAM_SUPERCEDE
}


I don't get it... what does C4 has to do with grenades ?





EDIT:

Code:
L 02/21/2009 - 04:40:16: Start of error session.
L 02/21/2009 - 04:40:16: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20090221.log")
L 02/21/2009 - 04:40:16: [HAMSANDWICH] Entity out of range (-1)
L 02/21/2009 - 04:40:16: [AMXX] Displaying debug trace (plugin "drop_all_weapons.amxx")
L 02/21/2009 - 04:40:16: [AMXX] Run time error 10: native error (native "ExecuteHam")
L 02/21/2009 - 04:40:16: [AMXX]    [0] drop_all_weapons.sma::Player_Killed (line 84)
Code:
 
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
RegisterHam(Ham_Killed, "player", "Player_Killed")
RegisterHam(Ham_CS_Item_CanDrop, "weapon_hegrenade", "Enable_Drop")
RegisterHam(Ham_CS_Item_CanDrop, "weapon_flashbang", "Enable_Drop")
RegisterHam(Ham_CS_Item_CanDrop, "weapon_smokegrenade", "Enable_Drop")
}
public Enable_Drop( iEnt )
{
SetHamReturnInteger(1)
return HAM_SUPERCEDE
}
public Event_HLTV_New_Round()
{
new iWpnBx = engfunc(EngFunc_FindEntityByString, FM_NULLENT, "classname", "weaponbox")
while( iWpnBx > 0 )
{
WeaponBox_Killed(iWpnBx)
iWpnBx = engfunc(EngFunc_FindEntityByString, iWpnBx, "classname", "weaponbox")
}
}
public Player_Killed( id )
{
new iActiveItem = get_pdata_cbase(id, m_pActiveItem, 5)
if( iActiveItem )
{
ExecuteHam(Ham_Item_Holster, iActiveItem, 1) - line 83
} - line 84

Last edited by Costin83; 02-21-2009 at 11:59.
Costin83 is offline
Send a message via Yahoo to Costin83
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-21-2009 , 16:44   Re: Drop All Weapons On Death
Reply With Quote #28

I have fixed this error in v0.3.3 replacing :

if( iActiveItem )

with

if( pev_valid( iActiveItem ) )

but should work with only :

if( iActiveItem > 0 )
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Costin83
Senior Member
Join Date: Jul 2008
Location: Romania
Old 02-21-2009 , 23:21   Re: Drop All Weapons On Death
Reply With Quote #29

Sorry to bother again with my "requests" but I still need another little "fix"

Seems like "nosil" plugin works fine with your "anti_fast_silence" plugin, no errors, bugs, whatsoever.
But "drop_weapons_on_death" still has a little "bug"; When you die un/silencing your weapon, the "anti_fast_silence" function is ignored, so you will drop a silenced weapon if you were silencing it or an unsilenced weapon if you unsilencing it. The problem is not there with "nosil" plugin; If you die silencing your weapon, you will still drop an unsilenced weapon in case the silencing annimation was not complete.

That's Y I ask if it's possible to "merge" this 3 plugins AIO, if it's not maybe another little fix for this "plugins missunderstanding eachother"

Big thanks in advance

btw: the fix in #29 solved the error posted in #28

Last edited by Costin83; 02-21-2009 at 23:29.
Costin83 is offline
Send a message via Yahoo to Costin83
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-23-2009 , 00:14   Re: Drop All Weapons On Death
Reply With Quote #30

There are a few mistakes and optimizations that can be made, however it is acceptable.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 12:45.


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