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

Removing C4 on C4 map CS:S


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tallio
Member
Join Date: Mar 2016
Old 03-14-2016 , 22:21   Removing C4 on C4 map CS:S
Reply With Quote #1

Hello Guys
I m looking for the way to remove the C4 mod on a C4 dedicated map...

I used this :

PHP Code:
public Action DropC4(Handle timerany client)
{
    if( 
IsClientConnected(client) && IsClientInGame(client) ){
        if(
IsPlayerAlive(client))
        {
            
int weaponIndex GetPlayerWeaponSlot(clientCS_SLOT_C4);
            if (
weaponIndex >= 0)
            {
                
CS_DropWeapon(clientweaponIndexfalse);
            }
        }
    }

But each time the C4 is dropped on the map, as soon after someone else on the T team get the C4 instead of my player... systematicaly
Tallio is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 03-14-2016 , 22:53   Re: Removing C4 on C4 map CS:S
Reply With Quote #2

use stripper:source
__________________
8guawong is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 03-14-2016 , 23:45   Re: Removing C4 on C4 map CS:S
Reply With Quote #3

I may be misunderstanding your situation, but why not remove the C4 instead of dropping it?

PHP Code:
RemovePlayerItem(clientweaponIndex); 

Last edited by Kolapsicle; 03-14-2016 at 23:47.
Kolapsicle is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 03-14-2016 , 23:50   Re: Removing C4 on C4 map CS:S
Reply With Quote #4

Not sure if it's this you need.

This removes c4 from being picked up by a player.
PHP Code:
#include <sourcemod>
#include <sdkhooks>

public OnClientPutInServer(client)
{
    
SDKHook(clientSDKHook_WeaponCanUseOnWeaponCanUse);
}

public 
Action:OnWeaponCanUse(clientweaponent
{
    if(
IsClientInGame(client) && IsPlayerAlive(client))
    {
        
decl String:Wep[32];
        
GetEdictClassname(weaponentWepsizeof(Wep));
        if(
StrContains(Wep"c4")>-1) {
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;

__________________
xines is offline
Tallio
Member
Join Date: Mar 2016
Old 03-15-2016 , 11:45   Re: Removing C4 on C4 map CS:S
Reply With Quote #5

Perefct Xines ! Exactly what i wanted
Thank you very much
Tallio is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 03-15-2016 , 16:36   Re: Removing C4 on C4 map CS:S
Reply With Quote #6

I'm not current on the changes, but something like this would work to remove the C4

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
public CS_RemoveBomb(client)
{
    new 
weapon_index = -1;
    
    for (new 
slot 0slot 6slot++)
    {
        while ((
weapon_index GetPlayerWeaponSlot(clientslot)) != -1)
        {
            if (
IsValidEntity(weapon_index))
            {
                if (
slot == CS_SLOT_C4)
                {
                    
RemovePlayerItem(clientweapon_index);
                    
AcceptEntityInput(weapon_index"kill");
                }
            }
        }
    }

__________________
View my Plugins | Donate
TnTSCS 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 13:23.


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