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

[SOLVED]Removing defuser of the floor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 11-02-2009 , 08:54   [SOLVED]Removing defuser of the floor
Reply With Quote #1

How?xD

Thanks

Last edited by #8 SickneSS; 11-03-2009 at 14:00.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-02-2009 , 12:04   Re: Removing defuser of the floor
Reply With Quote #2

No Weapon Drop

Search.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 11-03-2009 , 07:59   Re: Removing defuser of the floor
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
No Weapon Drop

Search.
Thanks,i make that....

PHP Code:
//Init
RegisterHam(Ham_Spawn,"weaponbox","Ham_Spawn_WeaponboxPost",1)

//Function
public Ham_Spawn_WeaponboxPost(Ent) {
        
    if(
get_pcvar_num(enable) == 1
    
&& get_pcvar_num(removeent) == 1
    {
        if(
pev_valid(Ent))
        {
        
engfunc(EngFunc_RemoveEntity,Ent)
       }
        return 
HAM_SUPERCEDE
    
}     
    return 
HAM_IGNORED

But,dont remove defuser:/

Last edited by #8 SickneSS; 11-03-2009 at 08:09.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-03-2009 , 08:19   Re: Removing defuser of the floor
Reply With Quote #4

Method taken from no weapon drop by VEN :

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("No Defuser On Ground"VERSION"ConnorMcLeod")

    
register_event("DeathMsg""Event_DeathMsg""a")
}

public 
Event_DeathMsg()
{
    new 
id read_data(2)
    if( 
cs_get_user_defuse(id) )
    {
        
cs_set_user_defuse(id0)
        
entity_set_int(idEV_INT_body0)
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-03-2009 at 08:26.
ConnorMcLeod is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 11-03-2009 , 09:20   Re: Removing defuser of the floor
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Method taken from no weapon drop by VEN :

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("No Defuser On Ground"VERSION"ConnorMcLeod")

    
register_event("DeathMsg""Event_DeathMsg""a")
}

public 
Event_DeathMsg()
{
    new 
id read_data(2)
    if( 
cs_get_user_defuse(id) )
    {
        
cs_set_user_defuse(id0)
        
entity_set_int(idEV_INT_body0)
    }


Thanks.

One question.

In my dedicated server with this code ...
PHP Code:
public Ham_Spawn_WeaponboxPost(Ent) {
        
    if(
get_pcvar_num(enable) == 1
    
&& get_pcvar_num(removeent) == 1
    {
        if(
pev_valid(Ent))
        {
        
engfunc(EngFunc_RemoveEntity,Ent)
       }
        return 
HAM_SUPERCEDE
    
}     
    return 
HAM_IGNORED

works good, but when you use the same on my hosted server crashes,I could fix it with task, but I dont know how to keep unused task.

Last edited by #8 SickneSS; 11-03-2009 at 09:26.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-03-2009 , 09:48   Re: Removing defuser of the floor
Reply With Quote #6

PHP Code:
RegisterHam(Ham_Spawn"weaponbox""WeaponBox_Spawn"1
PHP Code:
public WeaponBox_Spawn(iEnt)
{
    
entity_set_int(iEntEV_INT_flagsFL_KILLME)
    
call_think(iEnt)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-03-2009 , 10:14   Re: Removing defuser of the floor
Reply With Quote #7

It's a bad idea to remove at spawn, because calling call_think will do nothing and FL_KILLME will kill only the weaponbox and not the entities linked to the box too.

Code:
#include <amxmodx> #include <hamsandwich> #include <fakemeta> public plugin_init() {     RegisterHam( Ham_Touch, "weaponbox", "WeaponBox_Touch", 1 ); } public WeaponBox_Touch ( WeaponBox, Other ) {     dllfunc( DLLFunc_Think, WeaponBox ); }
__________________
Arkshine is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 11-03-2009 , 10:30   Re: Removing defuser of the floor
Reply With Quote #8

I did it with Fw_Touch, but the weapons were still in the ground, so then I did with Ham_Spawn.

@Connor

Works Perfect,Thanks!
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-03-2009 , 10:53   Re: Removing defuser of the floor
Reply With Quote #9

Arkshine is right, just checked and weapons are not removed.
Thought you can't pick them up, it can crash your server if there are too many (for example if there are no round end on your server like on csdm, kz, etc...)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-03-2009 at 11:01.
ConnorMcLeod is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 11-03-2009 , 11:22   Re: Removing defuser of the floor
Reply With Quote #10

test by urself

Last edited by #8 SickneSS; 01-17-2010 at 13:31.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
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 06:12.


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