Raised This Month: $134 Target: $400
 33% 

Bomb Status [ V 1.7 ]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   hornet (5)
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-01-2014 , 11:50   Bomb Status [ V 1.7 ]
Reply With Quote #1


Bomb Status 1.7
Release: 01.06.2014 | Last Update: 01.07.2016

Table of Contents

Description top


Shows a hud message with the following information about the bomb. It also has
a configuration file: bombstatus_configuration.ini
Read below to understand how to use them.

It's able to show this info:
  • Bomb Planted : Yes/No
  • BombSite : A/B/No
  • Status : Dropped/Carried/Bombed/Planting
  • Carrier/Planter : Name/ No ( if the bomb was planted will show Planter: Name )
  • Distance To Bomb: Distance
  • Explosion in: Time
  • Defuse: DefuseKit/Default

I think that it's need a better explanation:
  • BombPlanted: if the bomb is planted, it will show Yes, otherwise it will show NO.
  • BombSites: if the bomb is not planted will show No, otherwise it will show A / B.
  • Status: will show Dropped if the bomb is on the ground, Carried if a player has the bomb, Planting if the bomb is in planting process, Bombed if bomb exploded.
  • Carrier: if the bomb is not on the ground will show the name of the player who has it, otherwise will show No. In the case which the bomb is planted , will shows the name of player who planted it.
  • Distance To Bomb: if planted will display the distance, else it won't be displayed
  • Explosion in: if planted will display display this new info with the time until explosion. If bomb exploded, it won't display it any longer.
  • Defuse: if the player that defuse the bomb has a defuse kit it will show DefuseKit, else will show defult. When defuse proces stop,this info will dissapear.

This will also provide a command to control hud, in case it produce lag for you or sth like this.
  • Turn hud on.
  • Turn hud off.

Because some maps have reversed* bomb sites you may need to add this map in bombstatus_configuration.ini, under the [SWAPPED MAPS] key, if not plugin won't work correctly or use the menu so you can configure directly in game.
Also, if you find bugs please reply here with this info: plugin version, map name, problem description and others plugin that use hud messages or interact with the bomb.

Requirements top


Please make sure you have all the requirements:
  • Okapi module.
  • Cvar Util module.
  • An updated server without dproto.
    It may work into your outdated server with dproto, but if it doesn't, I won't help you.
Installation top

To install the plugin:
  1. Download the resources from this post. You need to get the source and compile it locally.
  2. Put bomb_status.amxx in addons/amxmodx/plugins
  3. Open addons/amxmodx/configs/plugins.ini and add at the end of this file bomb_status.amxx
  4. You can put the sma file into addons/amxmodx/sources but this is not mandatory.
  5. Put bombstatus.txt into [tt]addons/amxmodx/data/lang[/tt
  6. Restart the server/change map.

To install okapi:
  1. Download okapi_bin.zip and extrat the arhive.
  2. Copy okapi_amxx.dll/okapi_amxx_i386.so depending on your operation system into addons/amxmodx/modules
  3. The module will be auto-loaded, you don't need to add it into modules.ini

To install Cvar Util:
  1. Download cvar-util-files-1.6.zip and extrat the arhive.
  2. Copy cvar_util_amxx.dll/cvar_util_amxx_i386.so depending on your operation system into addons/amxmodx/modules
  3. The module will be auto-loaded, you don't need to add it into modules.ini

To compile locally:
  • First way:
    1. Download AMX Mod X for windows/linux from main site
    2. Extract somewhere the arhive and remember the folder!
    3. Copy the content from include folder from the okapi arhive into addons/amxmodx/scripting/include( in the folder created in the step 2 ).
    4. Download the source of the plugin( bomb_status.sma) from this post and drag it over the compile.exe(scripting folder from the arhive created at step 2)
    5. It will create a new folder called compiled. Open it and you will find your compiled plugin( bomb_status.amxx )
  • Second way:
    1. Go to http://spider.limetech.org/
    2. Copy/paste the code from the .sma file into the website.
    3. Under the big blue Compile button you see a box which Drop .inc files here
    4. Then press Compile and Download

If you don't know/want to compile locally, download the attached AMXX file(not the one from Get Plugin link).
Commands top

I've added the fallowing command:
  • say /ch_hud_state: Turn hudmessage on/off with say
  • say_team /ch_hud_state: Turn hudmessage on/off with say_team
  • bombstatus_cfgmenu: Open configuration menu so you won't need to edit the cfg file manually.

Write it once and it will disable the hud, write it after the spam protection(see below) and it will turn it on again.

A spam protection exists and it can be controled by cvar.
Cvars top


This cvars allow you to turn on/off most of the features and to control the way in which the plugin works.
  • bomb_status_team:
    • Control which team see the hud.
    • 0 - everyone can see it | 1 - only t | 2 - only ct
  • hud_r_color | hud_g_color | hud_b_color:
    • Allow you to change default hud color
    • Default: r - 0 | g - 255 | b - 85
    • Colors are in rgb format ( use paint to select a new one if you don't know them )
  • bomb_status_commands:
    • Allow you to enable/disable hud commands.
    • 0 - disabled | 1 - enable
  • bomb_status_c_spamtime:
    • Change the delay for the commands(the spam protection)
    • Default: 10 - this mean that the player needs to wait 10 seconds to use the command again.
  • bomb_status_logs:
    • Allow you to disable/enable logs.
    • At certain times, plugin will write some messages into server console, to let you know what happen.
    • 0 - disable | 1 - enable
  • bomb_status_disable_tp:
    • Allow to restrict teleportation after bomb was planted
    • Admin may abuse and teleport directly in order to defuse
    • 0 - disable | 1 - enable

Configuration top


1.Adding a map as swapped:
You have two ways of adding a map as swapped, but firstly let's find out what a swapped map is. Some maps have reversed bombsite so it means that instead of A it will show B and instead of B will be A.

1.1 Add the map into the file:
  • Go to addons/amxmodx/configs/bombstatus_configuration.ini
  • Under the [SWAPPED MAPS] key add your map name as it is in your maps dir.
  • Change map to apply the changes.
1.2 Using the configuration menu
  • While in game write bombstatus_cfgmenu
  • If the map is detected as swapped you will have the option to make it Normal. If it's detected as normal you will have an option to make it Swapped
  • Under menu title you will have current map status.
  • Use Teleport menu to go in A/B as they are detected by the plugin so you can check if the current config si correct. If not, reverse options.

2.Adding a map as blocked:
Open addons/amxmodx/configs/bombstatus_configuration.ini and under BLOCKED MAPS section add your map name and change the map to apply changes.

To acces the menu you need ban acces(flag "d") but it can be changed:
PHP Code:
const AdminAcces ADMIN_BAN 
Credits top
ChangeLog top
  • V 0.1:
    • Initial release
  • V 0.2:
    • Add two versions: dhud / HUD classic.
      Fix bug when name was displayed incorrectly.
  • V 0.3:
    • Add cvar bomb_status_team (which them see the hud)
    • Optimization for detecting the distance to the bomb site.]
  • V 0.4:
    • Now there is only one version with HUD and dhud.
    • Adding cvar bomb_hud_type
    • Arrange the code
    • Added swapped_maps.ini file
  • V 0.5:
    • Lowered the hold time for hud messages
    • Now HudSyncObjects are cached
    • Added is_user_connected check in GetName function
  • V 0.6:
    • Renamed almost all variables.
    • Now the plugin will be paused if we aren't running a map with bomb sites.
    • Removed some useless blocks of code.
    • Solved some problems with arrays.
    • Added a global task.
    • Fixed some problems in formatex.
    • Lowered the hold time for hud.
    • Removed an useless var in GetName stock.
    • Fixed a bug when bomb status is displayed incorrectly.
  • V 0.7:
    • Removed dhudmessages, now only normal hud messages are used.
    • Remove hud type cvar.
    • Optimized show hud function
  • V 0.8:
    • Added posibility to change hud color by cvar.
    • Added /hudon & /hudoff for turning hud on/off.
    • Added a spam protection for commands.
    • Added a new swapped map: de_train.
    • Added a new file where you can write on which map plugin should not run.
    • Moved all files in Bomb Status folder.
    • Added a cvar to enable/ disable commands
    • Added logs.
    • Added a cvar to control logs ( default 0 ).
    • Optimized a bit ShowHud function.
  • V 0.9:
    • Fixed a bug when a new round start.
    • Fixed a bug when you kill yourself.
    • Added a new bomb status: Bombed
    • Fixed a bug with sv_restart 1
    • Added a new status: Planting
    • Added a new hud info : Explosion in.
  • V 1.0:
    • Fixed a bug with planting status.
    • Changed hud position.
    • Some informations are displayed only when needed.
    • Removed useless checks.
    • Added a new info : Defuse : DefuseKit/ Default
    • Fixed a typo: Distante instead of Distance
  • V 1.1:
    • Renamed some variables
    • Added some comments
    • Fixed a possible bug in the very first round
    • Now using bitsum for booleans with 33 cells
    • Arranged the code
  • V 1.2:
    • Added all Hornet's improvements.
    • When players num is 0,hud is canceled.
  • V 1.3:
    • A lot of changes in terms of code
    • Merged the two configuration file into one.
    • Fixed some potential bugs.
  • V 1.4:
    • Added configuration menu
    • Improved planting status detection.
  • V 1.6:
    • Fixed defusing status, not it's working properly
    • Fixed a bug when time remaining untile explosion is not properly updated
    • Fixed a bug when, on some maps, teleport function will stuck you into the ground or into some boxes
    • Fixed a bug with removing line from file when tempfile path get wrong
    • Fixed a bug with adding lines to file when it leave a space after last line and the new added
    • Fixed registering twice Ham_WeaponIdle
    • Improved code readability
    • Fixed a wrong key in lang file
    • Added new translations into ml file
    • Now mp_c4timer is cached with CvarCache native
    • Removed treemap search
    • Teleport menu is now global
    • Teleport menu is not destroyed in plugin_end
    • Optimized FindBombSites function, now with 50% less native calls by doing some tricks
    • Fixed defusing status won't ever show up into hud
    • Fixed defusing status doesn't dissappear when defusion is canceled
    • Now using just a command to turn hud on/off, more convenient
    • Added check to see if c4 is valid in AddPlayerItem
    • Fixed origin swapping, now it's properly implemented
    • Fixed throwable c4 being detected as running even if not.
  • V 1.7:
    • Fixed a bug when planting status is not removed on GameCommencing event or NewRound
    • Fixed a bug with teleport function where on small bombsite it fails.
    • Fixed a bug with teleport function where, on some maps it teleport you above ground and you get fall damage
    • Fixed bugs with bombsite detection.
    • Added detection by infodecal entities which never fail. If no infodecals, it uses the standard method.
    • Added teleportation restrictions in freezetime and after bomb is planted(by cvar)
    • Fixed a bug when teleport function would transfer you to wrong bomb site.
    • Code cleaned and improved.
Attached Files
File Type: txt bombstatus.txt (7.7 KB, 724 views)
File Type: sma Get Plugin or Get Source (bomb_status.sma - 888 views - 22.6 KB)
File Type: amxx bomb_status.amxx (11.8 KB, 399 views)

Last edited by HamletEagle; 07-01-2016 at 13:25.
HamletEagle is online now
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 06-01-2014 , 12:26   Re: Bomb Status
Reply With Quote #2

sweet, nice idea..
i have no servers right now.. but when i will, i'll use it for sure.

LE: you can make a global task to show the hud, and loop all players instead individual task..
__________________

My PC Themes . .

Last edited by red_bull2oo6; 06-01-2014 at 12:29.
red_bull2oo6 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-01-2014 , 12:38   Re: Bomb Status
Reply With Quote #3

Quote:
Originally Posted by red_bull2oo6 View Post
sweet, nice idea..
i have no servers right now.. but when i will, i'll use it for sure.

LE: you can make a global task to show the hud, and loop all players instead individual task..
Thx for your oppinion. I'm going to make a global task or a thinking entity.
HamletEagle is online now
wickedd
Veteran Member
Join Date: Nov 2009
Old 06-01-2014 , 12:41   Re: Bomb Status
Reply With Quote #4

If the bomb is planted, how can someone be carrying it?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-01-2014 , 12:53   Re: Bomb Status
Reply With Quote #5

Quote:
Originally Posted by wickedd View Post
If the bomb is planted, how can someone be carrying it?
If the bomb is planted it will display the name of the player that planted it. Read the description better before asking something. If you saw this in the one of the image, they are older ( 0.1 version ) , I'll make new photos when I have time.

Last edited by HamletEagle; 06-01-2014 at 13:01.
HamletEagle is online now
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-01-2014 , 12:59   Re: Bomb Status
Reply With Quote #6

The message will be appear permanently?
ArabicMan is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 06-01-2014 , 13:01   Re: Bomb Status
Reply With Quote #7

I read the description. The picture you posted shows something different, that's why I asked the question.
Attached Thumbnails
Click image for larger version

Name:	O6Pn8iy.jpg
Views:	1700
Size:	95.2 KB
ID:	134031  
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-01-2014 , 13:04   Re: Bomb Status
Reply With Quote #8

Quote:
Originally Posted by wickedd View Post
I read the description. The picture you posted shows something different, that's why I asked the question.
The picture is very old ( 0.1 version ). Now everything is ok, but I have to make new photos, when I have time.

Quote:
Originally Posted by ArabicMan View Post
The message will be appear permanently?
Yes, it will be permanent, but I tested it on a 32/32 server with bots and it doesn't produce lag. If you have a sugestions, when it should not be displayed I'm glad to hear it.

Last edited by HamletEagle; 06-01-2014 at 13:05.
HamletEagle is online now
Backstabnoob
AMX Mod X Plugin Approver
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-01-2014 , 13:12   Re: Bomb Status
Reply With Quote #9

  • PHP Code:
    set_task 0.1 "ShowHud" id 
  • Why? You're displaying the message for 12 seconds. There's absolutely no reason to reshow it every 0.1 seconds. Also it will look really silly with director hud messages, because they have no channels and they will just overlap one over another so after those 12 seconds you'll have a big nice block of color if the content of the message changes a lot.
  • Also, cache the hud sync objects.
  • In GetName, check if the user is connected to the server. You don't even have to use this, just remove it entirely and get the name directly in the HUD function, just cache the bomb ent ID.
  • Also, instead of copying the contents of dhudmessage.inc, just leave it in the includes and point to it in your thread in case it gets updated or something.

I didn't look thoroughly but that's what you should start with if you want this to get approved.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
ArabicMan
Veteran Member
Join Date: Feb 2014
Location: مصر
Old 06-01-2014 , 13:14   Re: Bomb Status
Reply With Quote #10

It will make lag you can make cvar that control of that i can make it permanently or every x sec i think it will be better.
ArabicMan 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:47.


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