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

How to remove C4 bomb from user?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kketan77
Member
Join Date: Apr 2012
Location: India
Old 09-28-2012 , 05:39   How to remove C4 bomb from user?
Reply With Quote #1

Is this possible to remove c4 bomb from users inventory without being noticed?

(I dont like to see dropped c4 on ground on ground)

User must spawn with c4 bomb at every round.
The c4 bomb should be removed from inventory after the function is called!

[I want to know that thing which removes bomb from users inventory after it is planted on bomb site!]
__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀
kketan77 is offline
Send a message via Yahoo to kketan77
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-28-2012 , 06:01   Re: How to remove C4 bomb from user?
Reply With Quote #2

yes its possible
http://forums.alliedmods.net/showthread.php?t=56377
theres an example you could use to strip c4

Last edited by jimaway; 09-28-2012 at 06:03.
jimaway is offline
kketan77
Member
Join Date: Apr 2012
Location: India
Old 09-28-2012 , 06:04   Re: How to remove C4 bomb from user?
Reply With Quote #3

That's nice!

Can you give me example? or that function?
__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀
kketan77 is offline
Send a message via Yahoo to kketan77
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 09-28-2012 , 06:27   Re: How to remove C4 bomb from user?
Reply With Quote #4

copy the ham_strip_user_weapon stock from the code and uncomment the counter-strike block with C4.
Then simply use ham_strip_user_weapon( id, "weapon_c4" ).
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
kketan77
Member
Join Date: Apr 2012
Location: India
Old 09-30-2012 , 09:24   Re: How to remove C4 bomb from user?
Reply With Quote #5

Thnx solve
Code:
ham_strip_weapon(id,"weapon_c4")

I dont want make spam that's why i am posting another topic related with C4 bomb.


PHP Code:
public plugin_init()
{
    if(
find_ent_by_class(-1"func_bomb_target")>0||find_ent_by_class(-1"info_bomb_target")>0)
    {
        
RegisterHam(Ham_Spawn"player""inventory"true)
    }
}

public 
inventory(id)
{
    if( 
is_user_alive(id) && get_user_team(id) == && cs_get_user_bpammo(idCSW_C4) == )
    {
        
fm_give_item(id"weapon_c4")
    }

I tried to give C4 bomb to all terrorist when they spawn expect those who alredy have one C4 bomb.

Why above code is giving C4 bomb to all terrorist?
If terrorist is already have C4 bomb then it should not receive another C4 bomb.

My code is correct or not?
How could i stop default c4 giving function?
Or is there any another way to find if terrorist already have c4 bomb?

Is there any solution?


EDIT:

Thnx solved!

Game already have there default spawn function! For custom function it need little bit delay! It is done through set_task.

Tested and works perfect for me!

PHP Code:
public plugin_init()
{
    if(
find_ent_by_class(-1"func_bomb_target")>0||find_ent_by_class(-1"info_bomb_target")>0)
    {
        
RegisterHam(Ham_Spawn"player""inventory"true)
    }
}

public 
inventory(id)
{
    if( 
is_user_alive(id) && get_user_team(id) == 1)
    {
        
set_task(0.1"give_c4")
    }
}

public 
give_c4(id)
{
    if(
is_user_alive(id) && cs_get_user_bpammo(idCSW_C4) == 0)
    {
        
fm_give_item(id"weapon_c4")
        
cs_set_user_plant(id1)
    }

__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀

Last edited by kketan77; 09-30-2012 at 12:36. Reason: Solved C4 issue!
kketan77 is offline
Send a message via Yahoo to kketan77
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-30-2012 , 10:40   Re: How to remove C4 bomb from user?
Reply With Quote #6

the c4 is probably given after player spawns
jimaway is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 09-30-2012 , 18:38   Re: How to remove C4 bomb from user?
Reply With Quote #7

Hey, only block a user plant C4

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

#define SHOW_BOMB_ICON 0

public plugin_init()
{
    
register_plugin("Disable C4 Arm",AMXX_VERSION_STR,"SmileY");

    
register_event("CurWeapon","CurWeapon","be","1=1");
}

public 
CurWeapon(id)
{
    if(
get_user_weapon(id) == CSW_C4)
    {
        
cs_set_user_plant(id,0,SHOW_BOMB_ICON);

        
client_print(id,print_chat,"[AMXX] C4 Arming is now disabled.");
    }

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 09-30-2012 at 18:40.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 09-30-2012 , 20:17   Re: How to remove C4 bomb from user?
Reply With Quote #8

With orpheu hook "GiveC4" and supercede it
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS 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:53.


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