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

[FAQ/Tutorial] CS Bomb Scripting


Post New Thread Reply   
 
Thread Tools Display Modes
frk_14
Senior Member
Join Date: Jan 2009
Location: Argentina
Old 10-25-2012 , 01:28   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #71

is possible plant the bomb without carry it?
frk_14 is offline
Send a message via MSN to frk_14 Send a message via Skype™ to frk_14
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 01-24-2013 , 02:45   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #72

Quote:
Originally Posted by ConnorMcLeod View Post
About methods to plant bomb anywhere on the map, in few plugins i have looked, authors just remove existing bombsites and create a new hudge one.
I've found a way to increase size of existing bombsites and that those sizes are taken in account. All you need is to set modelindex to 0 before you send SetSize.
Problem if you set back modelindex is that when planter touches bombsite the game is freezing.
Solution i adopted is to set bombsites modelindex to 0 and to never set it back.
Seems to work so far :

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

#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN "Plant Anywhere"

enum _:m_BombSiteDatas
{
    
m_iEntity,
    
Float:m_fVecMins[3],
    
Float:m_fVecMaxs[3],
}

new Array:
g_aBombSites

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
register_concmd("amx_plant_anywhere""ConsoleCommand_PlantAnywhere"ADMIN_CFG"0/1")

    
g_aBombSites ArrayCreate(m_BombSiteDatas2)

    new 
mDatas[m_BombSiteDatas]
    new const 
szClasses[][] = { "func_bomb_target" "info_bomb_target" }
    new 
iEnt

    
for(new ii<sizeof(szClasses); i++)
    {
        
iEnt FM_NULLENT

        
while( (iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"szClasses[i])) )
        {
            
set_pev(iEntpev_modelindex0)

            
mDatas[m_iEntity] = iEnt
            pev
(iEntpev_minsmDatas[m_fVecMins])
            
pev(iEntpev_maxsmDatas[m_fVecMaxs])
            
ArrayPushArray(g_aBombSitesmDatas)
        }
    }
}

SetBombSites(bool:bOnAllMap)
{
    new 
iBombeSitesNum ArraySize(g_aBombSites)
    new 
mDatas[m_BombSiteDatas], iEnt
    
for(new ii<iBombeSitesNumi++)
    {
        
ArrayGetArray(g_aBombSitesimDatas)
        
iEnt mDatas[m_iEntity]
        if( 
bOnAllMap )
        {
            
engfunc(EngFunc_SetSizeiEntFloat:{-9999.0, -9999.0, -9999.0}, Float:{9999.09999.09999.0})
        }
        else
        {
            
engfunc(EngFunc_SetSizeiEntmDatas[m_fVecMins], mDatas[m_fVecMaxs])
        }
    }
}

public 
ConsoleCommand_PlantAnywhereid lvl cid )
{
    if( 
cmd_access(idlvlcid2) )
    {
        new 
szArg[2]
        
read_argv(1szArgcharsmax(szArg))
        
SetBombSitesszArg[0] == '1' true false )
    }
    return 
PLUGIN_HANDLED

Very nice code! Works fine, but not works on CS_, AS_, ES_ maps.. is pobbile make his working on cs_ ?
__________________
sorry my bad english...
alonelive is offline
yan1255
Senior Member
Join Date: Jul 2011
Old 03-02-2013 , 10:14   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #73

Planted bomb and Defused bomb are global events?
__________________
yan1255 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-02-2013 , 11:16   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #74

All is written in the first post. Depending what you want, you can rely on the BarTime game event, which is sent on a specific player, or on the log event which unrelated to player.
__________________
Arkshine is offline
kketan77
Member
Join Date: Apr 2012
Location: India
Old 10-13-2013 , 22:26   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #75

Well i want to know how to use this...
Code:
// Is player at the bomb target (func_bomb_target)?
    // Note: there are no good way to detect if player is at the info_bomb_target
    new target = -1, class[] = "func_bomb_target", bool:is_inside = false
    while ((target = fm_find_ent_by_class(target, class))) {
        if (!fm_boxents_distance(index, target)) {
            is_inside = true
            break
        }
    }
    if (is_inside)
PHP Code:
public plugin_init()
{
    new 
target = -1, class[] = "func_bomb_target"bool:is_inside false
    
while ((target fm_find_ent_by_class(target, class))) {
        if (!
fm_boxents_distance(indextarget)) {
            
is_inside true
            
break
        }
    }
    if (
is_inside)
    {
        
// my code
    
}

I have confusion where & how to declare this...

Does this come under plugin_init()???
Am i doing it right?

EDIT :
Posted to Scripting Help section.
__________________
♚ || -=[ḰḝṮẫṊ]=- || ᕙ(`▽´)ᕗ || (⊙.⊙(☉_☉)⊙.⊙) || ⁀⊙﹏☉⁀

Last edited by kketan77; 10-14-2013 at 03:31.
kketan77 is offline
Send a message via Yahoo to kketan77
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-14-2013 , 03:06   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #76

You are completely confused.
Also this thread is not about scripting help, please open a thread in scripting help forum.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 10-27-2014 , 07:05   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #77

Old thread bump.
How I can disable bomb disappearance when it defused?

Last edited by Phant; 10-27-2014 at 07:06.
Phant is offline
Send a message via ICQ to Phant
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-27-2014 , 08:01   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #78

You need to remove FL_KILLME flag on the bomb when this one is defused.
__________________
Arkshine is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 11-03-2014 , 18:52   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #79

Quote:
Originally Posted by Arkshine View Post
You need to remove FL_KILLME flag on the bomb when this one is defused.
Can you please give me example?
Phant is offline
Send a message via ICQ to Phant
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 11-11-2014 , 08:50   Re: [FAQ/Tutorial] CS Bomb Scripting
Reply With Quote #80

The best way to stop a bomb plant:

Code:
stock const m_pActiveItem = 373; stock const XO_CBASEPLAYER = 5; stop_plant(const client) {     new wpn = get_pdata_cbase(client, m_pActiveItem, XO_CBASEPLAYER);     if (wpn && cs_get_weapon_id(wpn) == CSW_C4) {         ExecuteHam(Ham_Weapon_WeaponIdle, wpn);     } }

Without sending commands to the player this will correctly reset internal weapon state, restore the player's speed, remove the progress bar from the screen and trigger the correct weapon animations. It can be used blindly, without having to check if the player is actually planting. Just use it whenever you want to make sure that the player stops planting, for example before teleporting them.
__________________
In Flames we trust!

Last edited by Nextra; 11-11-2014 at 08:59.
Nextra 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 15:58.


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