Raised This Month: $ Target: $400
 0% 

Stripping the c4


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-26-2009 , 18:56   Stripping the c4
Reply With Quote #1

Hi, i want to remove the c4 from the game. I tried to force the client to drop it but didn't works..
I follow this topic and i can't do it.
I can force the client to drop all their weapons but the c4 is not dropped!
I put this:
PHP Code:
    get_user_weapons(idiweaponsinum2)
    
    for(new 
a=0a<inum2a++) {
        
get_weaponname(iweapons[a], wpname31)
        
engclient_cmd(id"drop"wpname)
    } 
Mxnn is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-26-2009 , 19:23   Re: Stripping the c4
Reply With Quote #2

Try this.
PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <cstrike>
 
public plugin_init()
        
RegisterHam(Ham_Spawn"player""Spawn"1);
 
public 
Spawn(Client)
{
        
cs_set_user_plant(Client00);
        
entity_set_int(ClientEV_INT_body0);

__________________
hleV is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 12-26-2009 , 19:31   Re: Stripping the c4
Reply With Quote #3

PHP Code:
public plugin_init() { 

     
register_logevent("cmdRoundStart",2,"1=Round_Start")

PHP Code:
public cmdRoundStart() {
    
        for( new 
1get_maxplayers(); i++)
        {
            if(
get_pcvar_num(noc4)
            && 
user_has_weapon(i,CSW_C4))
            {
                
ham_strip_weapon(i,"weapon_c4")
            }
        }

PHP Code:
stock ham_strip_weapon(id,weapon[]) { /* By XxAvalanchexX */
    
    
if(!equal(weapon,"weapon_",7)) return 0;
    
    new 
wId get_weaponid(weapon);
    if(!
wId) return 0;
    
    new 
wEnt;
    while((
wEnt engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
    if(!
wEnt) return 0;
    
    if(
get_user_weapon(id) == wIdExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
    
    if(!
ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
    
ExecuteHamB(Ham_Item_Kill,wEnt);
    
    
set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
    
    if(
wId == CSW_C4)
    {
        
cs_set_user_plant(id,0,0);
        
cs_set_user_bpammo(id,CSW_C4,0);
    }
    else if(
wId == CSW_SMOKEGRENADE || wId == CSW_FLASHBANG || wId == CSW_HEGRENADE)
        
cs_set_user_bpammo(id,wId,0);
    
    return 
1;

i used this for warmup mod.

Last edited by #8 SickneSS; 12-26-2009 at 19:37.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 12-26-2009 , 19:44   Re: Stripping the c4
Reply With Quote #4

i use this on my plugin and it worked well

PHP Code:
// How to force a player to drop the bomb?
    
engclient_cmd(id"drop""weapon_c4")
 
// How to remove the dropped bomb?
    
new weapboxbomb fm_find_ent_by_class(-1"weapon_c4")
    if (
bomb && (weapbox pev(bombpev_owner)) > get_maxplayers()) {
        
dllfunc(DLLFunc_Thinkweapbox// will remove weaponbox + weapon_c4 entity pair
        // remove blinking red bomb mark on the radar
        
message_begin(MSG_ALLget_user_msgid("BombPickup"))
        
message_end()
    } 
its from the tutorial
platzpatrone is offline
master4life
Senior Member
Join Date: Mar 2006
Location: Germany
Old 12-26-2009 , 19:44   Re: Stripping the c4
Reply With Quote #5

Test this, without bombzone no Bomb for Ts

PHP Code:
#include < amxmodx >
#include < engine >

public plugin_init( ) {
    
register_plugin"Remove Bombzone""0.1""master4life" );
    
    
remove_entity_name"func_bomb_target" );
    
remove_entity_name"info_bomb_target" );

__________________


[img]http://img714.**************/img714/8612/33726.png[/img]

Last edited by master4life; 12-26-2009 at 19:47.
master4life is offline
Send a message via ICQ to master4life Send a message via MSN to master4life Send a message via Skype™ to master4life
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-26-2009 , 22:38   Re: Stripping the c4
Reply With Quote #6

Thanks all! I can resolve it with the master4life stuf!

But i have a question.. Which is the best method to find a entity in a map?
Mxnn is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-27-2009 , 15:33   Re: Stripping the c4
Reply With Quote #7

It depends on which type of ent you search, and on what you already know about the entity you are searching for.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-27-2009 , 16:05   Re: Stripping the c4
Reply With Quote #8

I tried to search in a map the entity "func_bomb_target" or "hostage_entity".. If exists delete it
But i search a function to do this but i don't know which function do this
Mxnn is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-27-2009 , 16:06   Re: Stripping the c4
Reply With Quote #9

Then use find_ent_by_class
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 12-27-2009 , 16:51   Re: Stripping the c4
Reply With Quote #10

Thanks! +k
Mxnn 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 04:08.


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