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

[CSS] ignore weapon_c4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
w4rkr4f7
Member
Join Date: Dec 2008
Old 04-01-2012 , 14:14   [CSS] ignore weapon_c4
Reply With Quote #1

Hello .how can i make this plugin to ignore weapon_c4 ?? I want to stay on ground if a player who carry c4 is dead. Thank You

PHP Code:
new Handle:Cvar_Removeweapons;
new 
g_WeaponParent;

public 
OnPluginStart()
{
    
CreateConVar("sm_Weaponcleanup_version"PLUGIN_VERSION"WeaponCleanup version",     FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
Cvar_Removeweapons CreateConVar("Removeweapons_on""1""1 Removeweapons on 0 is off"FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
g_WeaponParent FindSendPropOffs("CBaseCombatWeapon""m_hOwnerEntity");

        
RegAdminCmd("sm_cleanup"Command_ManualADMFLAG_SLAY);

    
HookEventEx("player_death"CleanupEventHookMode_Post);

    
HookEventEx("round_start"CleanupEventHookMode_Post);
}

public 
Action:Cleanup(Handle:event,const String:name[],bool:dontBroadcast)
{
        if (!
GetConVarBool(Cvar_Removeweapons))
    {
        return 
Plugin_Continue;
    }
    new 
maxent GetMaxEntities(), String:weapon[64];
    for (new 
i=GetMaxClients();i<maxent;i++)
    {
        if ( 
IsValidEdict(i) && IsValidEntity(i))
        {
            
GetEdictClassname(iweaponsizeof(weapon));
            if ( ( 
StrContains(weapon"weapon_") != -1) && GetEntDataEnt2(ig_WeaponParent) == -)
                    
RemoveEdict(i);
        }
    }    
    return 
Plugin_Continue;
}

public 
Action:Command_Manual(clientargs)
{
    new 
maxent GetMaxEntities(), String:weapon[64];
    for (new 
i=GetMaxClients();i<maxent;i++)
    {
        if ( 
IsValidEdict(i) && IsValidEntity(i) )
        {
            
GetEdictClassname(iweaponsizeof(weapon));
            if ( ( 
StrContains(weapon"weapon_") != -1) && GetEntDataEnt2(ig_WeaponParent) == -)
                    
RemoveEdict(i);
        }
    }    
    return 
Plugin_Continue;

w4rkr4f7 is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 04-01-2012 , 14:39   Re: [CSS] ignore weapon_c4
Reply With Quote #2

PHP Code:
new Handle:Cvar_Removeweapons;
new 
g_WeaponParent;

public 
OnPluginStart()
{
    
CreateConVar("sm_Weaponcleanup_version"PLUGIN_VERSION"WeaponCleanup version",     FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
Cvar_Removeweapons CreateConVar("Removeweapons_on""1""1 Removeweapons on 0 is off"FCVAR_PLUGIN|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
g_WeaponParent FindSendPropOffs("CBaseCombatWeapon""m_hOwnerEntity");

        
RegAdminCmd("sm_cleanup"Command_ManualADMFLAG_SLAY);

    
HookEventEx("player_death"CleanupEventHookMode_Post);

    
HookEventEx("round_start"CleanupEventHookMode_Post);
}

public 
Action:Cleanup(Handle:event,const String:name[],bool:dontBroadcast)
{
        if (!
GetConVarBool(Cvar_Removeweapons))
    {
        return 
Plugin_Continue;
    }
    new 
maxent GetMaxEntities();
    
decl String:weapon[64];
    for (new 
i=MaxClients+1;i<maxent;i++)
    {
        if ( 
IsValidEdict(i))
        {
            
GetEdictClassname(iweaponsizeof(weapon));
            if ( ( 
StrContains(weapon"weapon_") != -1) && !StrEqual(weapon"weapon_c4"false) && GetEntDataEnt2(ig_WeaponParent) == -)
                    
RemoveEdict(i);
        }
    }    
    return 
Plugin_Continue;
}

public 
Action:Command_Manual(clientargs)
{
    new 
maxent GetMaxEntities();
    
decl String:weapon[64];
    for (new 
i=MaxClients+1;i<maxent;i++)
    {
        if ( 
IsValidEdict(i))
        {
            
GetEdictClassname(iweaponsizeof(weapon));
            if ( ( 
StrContains(weapon"weapon_") != -1) && !StrEqual(weapon"weapon_c4"false && GetEntDataEnt2(ig_WeaponParent) == -)
                    
RemoveEdict(i);
        }
    }    
    return 
Plugin_Continue;


Last edited by Despirator; 04-01-2012 at 14:39.
Despirator is offline
w4rkr4f7
Member
Join Date: Dec 2008
Old 04-01-2012 , 15:00   Re: [CSS] ignore weapon_c4
Reply With Quote #3

Thank you so much ,is working good. Have a good day

Last edited by w4rkr4f7; 04-05-2012 at 06:54.
w4rkr4f7 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 16:44.


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