Raised This Month: $ Target: $400
 0% 

How to remove C4 bomb from user?


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



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 08:19.


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