Raised This Month: $ Target: $400
 0% 

[CSS] ignore weapon_c4


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 21:28.


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