Raised This Month: $32 Target: $400
 8% 

[L4D2]Remove attached entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 07-28-2022 , 17:01   [L4D2]Remove attached entities
Reply With Quote #1

does anyone know any script in which to remove all entities attached to the client with one command?

EXEAMPLE: !delete_attach
delete: Wings, LMC and Hats

I tried with my script, but the game crashes

Spoiler


who knew please help me
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube

Last edited by King_OXO; 07-28-2022 at 17:05.
King_OXO is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-28-2022 , 18:16   Re: [L4D2]Remove attached entities
Reply With Quote #2

You can try using the function made by Silvers in [ANY] Dev Cmds

Test first using "sm_attachments <client>" and check the output, if it does work the code is based on the snipper below.

Note: You may filter other stuff like weapons etc that may be attached as well.

PHP Code:
void GetAttachments(int clientint target)
{
    
char classname[64];

    for( 
int i 12048i++ )
    {
        if( 
IsValidEntity(i) && HasEntProp(iProp_Send"moveparent") && GetEntPropEnt(iProp_Send"moveparent") == target )
        {
            
GetEdictClassname(iclassnamesizeof(classname));
            if( 
target <= MaxClients )
            {
                
ReplyToCommand(client"Attachment %N: %d %s"targeticlassname);
            } else {
                
ReplyToCommand(client"Attachment %d: %d %s"targeticlassname);
            }
        }
    }

__________________
Marttt is offline
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 07-28-2022 , 18:55   Re: [L4D2]Remove attached entities
Reply With Quote #3

Quote:
Originally Posted by Marttt View Post
You can try using the function made by Silvers in [ANY] Dev Cmds

Test first using "sm_attachments <client>" and check the output, if it does work the code is based on the snipper below.

Note: You may filter other stuff like weapons etc that may be attached as well.

PHP Code:
void GetAttachments(int clientint target)
{
    
char classname[64];

    for( 
int i 12048i++ )
    {
        if( 
IsValidEntity(i) && HasEntProp(iProp_Send"moveparent") && GetEntPropEnt(iProp_Send"moveparent") == target )
        {
            
GetEdictClassname(iclassnamesizeof(classname));
            if( 
target <= MaxClients )
            {
                
ReplyToCommand(client"Attachment %N: %d %s"targeticlassname);
            } else {
                
ReplyToCommand(client"Attachment %d: %d %s"targeticlassname);
            }
        }
    }

thank you, you always help me
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube
King_OXO is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 08-05-2022 , 15:35   Re: [L4D2]Remove attached entities
Reply With Quote #4

It's better to use plugin-specific commands to clear its stuff, instead of forcibly remove them on your own. You risk having crash if the dependent plugin coded with not enough safety.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
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:00.


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