AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]Removing defuser of the floor (https://forums.alliedmods.net/showthread.php?t=108162)

#8 SickneSS 11-02-2009 08:54

[SOLVED]Removing defuser of the floor
 
How?xD

Thanks

Exolent[jNr] 11-02-2009 12:04

Re: Removing defuser of the floor
 
No Weapon Drop

Search.

#8 SickneSS 11-03-2009 07:59

Re: Removing defuser of the floor
 
Quote:

Originally Posted by Exolent[jNr] (Post 978908)
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:/

ConnorMcLeod 11-03-2009 08:19

Re: Removing defuser of the floor
 
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)
    }



#8 SickneSS 11-03-2009 09:20

Re: Removing defuser of the floor
 
Quote:

Originally Posted by ConnorMcLeod (Post 979590)
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.

ConnorMcLeod 11-03-2009 09:48

Re: Removing defuser of the floor
 
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)



Arkshine 11-03-2009 10:14

Re: Removing defuser of the floor
 
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 ); }

#8 SickneSS 11-03-2009 10:30

Re: Removing defuser of the floor
 
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!

ConnorMcLeod 11-03-2009 10:53

Re: Removing defuser of the floor
 
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...)

#8 SickneSS 11-03-2009 11:22

Re: Removing defuser of the floor
 
test by urself


All times are GMT -4. The time now is 17:44.

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