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

[HELP] Remove bomb..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 05-14-2018 , 19:54   [HELP] Remove bomb..
Reply With Quote #1

I have looked in these threads and tried some of the code without any luck.

https://forums.alliedmods.net/showth...=40164?t=40164
https://forums.alliedmods.net/showthread.php?p=2289060
https://forums.alliedmods.net/showthread.php?p=1796448

Some code simply dropped the bomb and would not let me pick it up.
This is not an option as it will interfere with gameplay.
And other code did nothing although it compiled without errors.

How do I properly remove the bomb entity and hud from a player?

Thanks
suhdude is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-14-2018 , 20:42   Re: [HELP] Remove bomb..
Reply With Quote #2

PHP Code:

public plugin_init() 
{
    
set_task(1.0"Removec4")
}

public 
Removec4()
{
    new 
iEnt = -1;

    while((
iEnt engfunc(EngFunc_FindEntityByString,iEnt,"classname","func_bomb_target")) > 0)
    {
        
set_pev(iEnt,pev_classname,"_func_bomb_target");
    }

    while((
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname""info_bomb_target" )) > 0)
    {
        
set_pev(iEnt,pev_classname,"_info_bomb_target");
    }

iceeedr is offline
Send a message via Skype™ to iceeedr
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 05-15-2018 , 05:29   Re: [HELP] Remove bomb..
Reply With Quote #3

Quote:
Originally Posted by iceeedr View Post
PHP Code:

public plugin_init() 
{
    
set_task(1.0"Removec4")
}

public 
Removec4()
{
    new 
iEnt = -1;

    while((
iEnt engfunc(EngFunc_FindEntityByString,iEnt,"classname","func_bomb_target")) > 0)
    {
        
set_pev(iEnt,pev_classname,"_func_bomb_target");
    }

    while((
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname""info_bomb_target" )) > 0)
    {
        
set_pev(iEnt,pev_classname,"_info_bomb_target");
    }

This only removes the plantzone correct?
Players still drop the bomb and it makes a noise when you pick it up.

Thanks.
suhdude is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-15-2018 , 06:02   Re: [HELP] Remove bomb..
Reply With Quote #4

This removes the zone, c4 and hud. Test and see.
iceeedr is offline
Send a message via Skype™ to iceeedr
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 05-15-2018 , 07:07   Re: [HELP] Remove bomb..
Reply With Quote #5

Quote:
Originally Posted by iceeedr View Post
This removes the zone, c4 and hud. Test and see.
Thank you I should have tested it first.
I have one problem now, when the bomb explodes round is not over.
I have a function that automatically plants a bomb at the bomb site.

That is why I want to remove bomb, but team should also be able to win.


Thanks a ton!
suhdude is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 05-15-2018 , 07:33   Re: [HELP] Remove bomb..
Reply With Quote #6

SOLVED

//This removes bomb when it is dropped

Code:
public plugin_init()
{
    RegisterHam(Ham_Spawn, "weaponbox", "RemoveWeaponbox", 1) 
}

public RemoveWeaponbox(ent)
{
    entity_set_int(ent, EV_INT_flags, FL_KILLME);
    call_think(ent);
}

Last edited by suhdude; 05-15-2018 at 07:48.
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-15-2018 , 11:28   Re: [HELP] Remove bomb..
Reply With Quote #7

Quote:
Originally Posted by suhdude View Post
SOLVED

//This removes bomb when it is dropped

Code:
public plugin_init()
{
    RegisterHam(Ham_Spawn, "weaponbox", "RemoveWeaponbox", 1) 
}

public RemoveWeaponbox(ent)
{
    entity_set_int(ent, EV_INT_flags, FL_KILLME);
    call_think(ent);
}
No need to set FL_KILLME, calling think should be enough.
__________________
HamletEagle is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-15-2018 , 10:32   Re: [HELP] Remove bomb..
Reply With Quote #8

This will remove all weaponboxes. Check if the world model it's of the C4.
__________________









Last edited by CrazY.; 05-15-2018 at 10:32.
CrazY. is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 05-16-2018 , 09:47   Re: [HELP] Remove bomb..
Reply With Quote #9

Quote:
Originally Posted by CrazY. View Post
This will remove all weaponboxes. Check if the world model it's of the C4.
How would I do this in a good way..
I solved it using a variable, it is not nice but it works.

I'm guessing I should have used something like find_ent_by_model.

Quote:
Originally Posted by HamletEagle View Post
No need to set FL_KILLME, calling think should be enough.
When I deleted that line, bomb was not removed from the ground.
You mean I don't need that line when I have found c4 ent specifically?

I would like to know why I get a tag mismatch when I try to change the planted bomb radar coordinates.

Code:
        origin[0] = 1108.650879
        origin[1] = 2571.609863
        origin[2] = 132.031250
        message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 1) 
        write_coord(origin[0]);
        write_coord(origin[1]);
        write_coord(origin[2]);
        write_byte(1);
        message_end();

Last edited by suhdude; 05-16-2018 at 10:48.
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-16-2018 , 13:36   Re: [HELP] Remove bomb..
Reply With Quote #10

write_coord wants an integer, you are providing a float. Use EngFunc_WriteCoord.
__________________

Last edited by HamletEagle; 05-16-2018 at 13:37.
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 07:37.


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