AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Defuse Kits on Ground (https://forums.alliedmods.net/showthread.php?t=167770)

Doc-Holiday 09-19-2011 21:42

Defuse Kits on Ground
 
Whats the best method to remove them from the ground??

For some reason registering touch of "player" doesnt trigger when picking up the difuser from the ground so im not sure of a class name and not much on the forums other then

cs_set_user_defuse(id, 1/0)

Fedde 09-19-2011 22:52

Re: Defuse Kits on Ground
 
Use this in DeadMsg event.
Code:
cs_set_user_defuse(id,0); entity_set_int(id,EV_INT_body,0);

Doc-Holiday 09-19-2011 22:58

Re: Defuse Kits on Ground
 
Quote:

Originally Posted by Fedde (Post 1559173)
Use this in DeadMsg event.
Code:
cs_set_user_defuse(id,0); entity_set_int(id,EV_INT_body,0);

im using Ham_Killed and even in pre it wont remove them theres things i use Ham for that cant be done in deathmsg so i would like to find a way to remove them from the ground if possible.

Fedde 09-19-2011 22:59

Re: Defuse Kits on Ground
 
Quote:

Originally Posted by Doc-Holiday (Post 1559174)
im using Ham_Killed and even in pre it wont remove them theres things i use Ham for that cant be done in deathmsg so i would like to find a way to remove them from the ground if possible.

Then make a task,check the entity,and remove it.

Doc-Holiday 09-19-2011 23:01

Re: Defuse Kits on Ground
 
Quote:

Originally Posted by Fedde (Post 1559175)
Then make a task.

its already to late not early.... I cant find a classname for them nor a way of getting the ents ID obv.. it has to have something since you can pick them up when they are on the ground. but

Using ham touch and get user aiming havnt given me any info on them

When using get user aiming it returns worldspawn and him touch doesnt even register i touched it when i picked it up.

Fedde 09-19-2011 23:03

Re: Defuse Kits on Ground
 
Oh sry,the entity classname is 'item_thighpack'.

Doc-Holiday 09-19-2011 23:06

Re: Defuse Kits on Ground
 
Quote:

Originally Posted by Fedde (Post 1559177)
Oh sry,the entity classname is 'item_thighpack'.

Even when on ground??

so i should be able to register ham_spawn with item_thighpack? lol ima go try it.

Fedde 09-19-2011 23:08

Re: Defuse Kits on Ground
 
Ok,post the code if you need help again xD.

Doc-Holiday 09-19-2011 23:14

Re: Defuse Kits on Ground
 
Quote:

Originally Posted by Fedde (Post 1559179)
Ok,post the code if you need help again xD.

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>


public plugin_init()
{
    
register_plugin("Plugin Name""Version""Author");
    
RegisterHam(Ham_Spawn"item_thighpack""fwdWeaponDrop"1);
    
RegisterHam(Ham_Spawn"weaponbox""fwdWeaponDrop"1); //Weapon box spawn
    
RegisterHam(Ham_Spawn"armoury_entity""fwdWeaponDrop"1); //Armor entity Spawn
}
public 
fwdWeaponDrop(iEnt)
{    
    if(
pev_valid(iEnt))
    {
        
client_print(0print_chat"SPAWN FIRED");
       
// set_task(0.5, "RemoveWeapons", iEnt);
    
}
}

public 
RemoveWeapons(iEnt)
{
    if(
pev_valid(iEnt))
    {
        new 
szModelName[32];
        
pev(iEntpev_modelszModelNamecharsmax(szModelName));
        
        if(
containi(szModelName"backpack") == -1)
        {
            
set_pev(iEntpev_flagsFL_KILLME);
            
ExecuteHam(Ham_ThinkiEnt);
        }
    }


item_thighpack no spawn?

Fedde 09-19-2011 23:27

Re: Defuse Kits on Ground
 
Spawn : Is called when the player get (Buy or taked)

Use with Touch.


All times are GMT -4. The time now is 19:30.

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