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

I'll plant the bomb on... 2.3.0 - Let your team know where you'll plant


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Arkshine (91)
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 06-14-2011 , 09:28   I'll plant the bomb on... 2.3.0 - Let your team know where you'll plant
Reply With Quote #1

I'll plant the bomb on... - v2.3.0 by Kidev
So your team will know


Description:

This plugin asks (via a menu) to the terrorist who spawns with the bomb on which bomb site he intends to plant the bomb. The terrorist can change his choice after 10 seconds (changeable via a cvar, see below) by left cliking while holding the bomb (right clik is impossible, sorry). He can't change his choice more than one time (changeable via a cvar, see below). If an another terrorist than the one who spawns with the bomb collect it, he can choose his own strategy (changeable via a cvar too, see below) etc...

You can change the "Cover me" sound by changing this:
PHP Code:
#define RADSOUND "radio/ct_coverme.wav" 
and replacing "radio/ct_coverme.wav" by any sound you want (must be a *.wav mono sound).

My plugin support from 1 to 5 bomb sites, which are listed whith their names in a menu.


Cvars:

ipo_toogle (Default: 1)
  • 1: Plugin is enabled.
  • 0: Plugin is disabled.

ipo_change_cooldown
(Default: 10.0)
  • Changes the cool down between two menu open (must be a float).

ipo_change_limit
(Default: 1)
  • Maximum times a player is allowed to open the menu.

ipo_print_mode (Default: 2)
  • 1: Print "[AMXX] Your teammate will plant the bomb on %s! Cover him!" in chat text to all Terrorists.
  • 2: Print "I will plant the bomb on %s, cover me!" in say_team to all Terrorists [More realisctic].
  • 3: Print "Your teammate will plant the bomb on %s! Cover him!" in center say to all Terrorists.

ipo_use_rad_cmd
(Default: 1)
  • 0: "Cover me!" sound disabled.
  • 1: "Cover me!" sound enabled.

ipo_reopen_mode
(Default: 2)
  • 0: Menu is opened only once a round (on bomb's owner spawn).
  • 1: Menu is re-openable by the terrorist who have the bomb (no matter if he spawn with or not) by right cliking.
  • 2 or more: Menu re-opens automatically if bomb is collected on the floor and is re-openable by by right cliking.


To do:

Nothing, this plugin is complete.


Changelog:
Code:
v2.3.0 @ 21/11/14
* Fixed an array-related error in menu
v2.2.0 @ 05/11/14
* Removed some dust and added some MLs
v2.1.0
* Replaced array sizes by a macro
v2.0.0 
+ Added the possibility to reopen the menu with a left clik while holding the bomb (left clik is impossible, sorry)
+ Added automatic menu re-open when bomb is collected on the floor
+ Added cool down and max changing limit (to prevent flood)
+ Added a cvar to toogle plugin
+ Added a cvar to change cool down's time
+ Added a cvar to change change's limit
+ Added all the ML's
* Changed the variable's names
v1.5.0
* Optimizations
v1.4.0
* Optimizations
v1.3.0 
* Optimizations
v1.2.0 
+ Added ML support and first public release
v1.0.0 
^ First public version

Credits:

VEN - For his CS Bomb Scripting tutorial
ConnorMcLeod - For a lot of optimizations (v1.3 .. v1.5)
TenK - For some testing


Multi-Lingual:

- EN: -Kid-
- FR: -Kid-
- ES: paoliita
- DE: Mordekay
- BG: papyrus_kn and r14170
- MY: JoKeR LauGh
- BP: wlacobain
- RU: alonelive
- TR: Carbon3180 and xD_1991
- SR: RepeR. (Incomplete because of the update)
- NL: drekes (Incomplete because of the update)
- PL: Abes_Ziomal_PL(Poland) (Incomplete because of the update)

Code:
[en]
IPO_MENU_TITLE = I will plant the bomb on ...
IPO_PLANT_ON = Your teammate will plant the bomb on %s! Cover him!
IPO_ILL_PLANT_ON = I will plant the bomb on %s, cover me!
IPO_LIMIT_REACHED = You have reached the limit of change strategy (%i)
IPO_MUST_WAIT = You must still wait %i second(s) before changing your strategy
IPO_CHANGE_STRAT = Choose your strategy
Current version (stable):
Attached Files
File Type: sma Get Plugin or Get Source (ipo_2.3.0.sma - 2244 views - 5.7 KB)
File Type: txt ipo.txt (4.7 KB, 867 views)
__________________

Last edited by Kidev; 11-20-2014 at 18:59.
Kidev is offline
mohsen9010
Senior Member
Join Date: Jun 2011
Location: Iran
Old 06-14-2011 , 09:39   Re: I'll plant the bomb on...
Reply With Quote #2

nice
mohsen9010 is offline
Send a message via Yahoo to mohsen9010 Send a message via Skype™ to mohsen9010
mohsen9010
Senior Member
Join Date: Jun 2011
Location: Iran
Old 06-14-2011 , 09:44   Re: I'll plant the bomb on...
Reply With Quote #3

can u answer my req ? http://forums.alliedmods.net/showthread.php?t=159228
mohsen9010 is offline
Send a message via Yahoo to mohsen9010 Send a message via Skype™ to mohsen9010
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-14-2011 , 11:22   Re: I'll plant the bomb on...
Reply With Quote #4

Does this plug-in the time interval between messages in the chat room and on the radio?
For flood control..
__________________
sorry my bad english...
alonelive is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 06-14-2011 , 11:25   Re: I'll plant the bomb on...
Reply With Quote #5

The menu which ask "Where will you plant the bomb" displays only if the player spawn with bomb (1 time by round), no flood risk.
__________________
Kidev is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 06-14-2011 , 11:31   Re: I'll plant the bomb on...
Reply With Quote #6

Neat
Code:
[de]
MENU_TITLE = Ich werde die Bombe platzieren auf ...
PLANT_ON = Dein Kamerad will die Bombe auf %s platzieren! Schuetze ihn!
ILL_PLANT_ON = Ich werde die Bombe auf %s platzieren, schuetze mich!
LIMIT_REACHED = Du hast deine Strategie zu oft gewechselt (%i)
MUST_WAIT = Du musst noch %i Sekunde(n) warten bevor du deine Strategie aendern kannst
CHANGE_STRAT = Waehle deine Strategie
__________________


Last edited by Mordekay; 09-18-2011 at 09:44. Reason: updated langfile
Mordekay is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-14-2011 , 11:38   Re: I'll plant the bomb on...
Reply With Quote #7

Don't include fakemeta util only for fm_find_ent_by_class stock.
Put the stock in your plugin or directly put engfunc( in code, or use find_ent_by_class native from engine module.

Also, make a check for info_bomb_target (the other possible bombsite classname).
You don't need to count them, just register stuff if you find one.

You misused LANG_SERVER, use LANG_PLAYER when you use index=0, use player index (here 'id') when you want to use receiver language, and use LANG_SERVER when you want to force player to see server language (i don't think you want here).
EDIT
I see what you want to do, then don't put this in the loop or chat will be duplicated (at least chat attempts that will be be blocked due to antoflood plugin or cs limitation), also you could use engclient_cmd there but you can't format with this command (your choice).
/EDIT

set_fail_state is rather to use when something goes wrong with the plugin so that you have no other choice than disable it.
You coud instead do the check at begining of plugin_init and if there are no bombsite, don't register logevent and menu, and pause the plugin if you want with pause() native.

Cache get_pcvar_num( useradcmd ) value before you execute the loop and iPlayers[ i ] at the start of each loop iteration.

In eventSpawnedWithBomb, check that id is not equal to 0 (or make the alive check before has weapon check).

PHP Code:
            formatexmenuformatcharsmaxmenuformat ), "%s"bombsite] );
            
menu_additemmenumenuformat ); 
You don't format anything here, use rather :

PHP Code:
            menu_additemmenubombsite] ); 

I think it's all.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-14-2011 at 11:46.
ConnorMcLeod is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-14-2011 , 11:40   Re: I'll plant the bomb on...
Reply With Quote #8

Quote:
Originally Posted by -Kid- View Post
The menu which ask "Where will you plant the bomb" displays only if the player spawn with bomb (1 time by round), no flood risk.
Can you made this plugin like follows:

When a player starts to lay a bomb, a chat message will be written "player sets the C4 on A|B. And a radio-message "Cover me".
__________________
sorry my bad english...
alonelive is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 06-14-2011 , 12:46   Re: I'll plant the bomb on...
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
Don't include fakemeta util only for fm_find_ent_by_class stock.
Put the stock in your plugin or directly put engfunc( in code, or use find_ent_by_class native from engine module.

Also, make a check for info_bomb_target (the other possible bombsite classname).
You don't need to count them, just register stuff if you find one.

You misused LANG_SERVER, use LANG_PLAYER when you use index=0, use player index (here 'id') when you want to use receiver language, and use LANG_SERVER when you want to force player to see server language (i don't think you want here).
EDIT
I see what you want to do, then don't put this in the loop or chat will be duplicated (at least chat attempts that will be be blocked due to antoflood plugin or cs limitation), also you could use engclient_cmd there but you can't format with this command (your choice).
/EDIT

set_fail_state is rather to use when something goes wrong with the plugin so that you have no other choice than disable it.
You coud instead do the check at begining of plugin_init and if there are no bombsite, don't register logevent and menu, and pause the plugin if you want with pause() native.

Cache get_pcvar_num( useradcmd ) value before you execute the loop and iPlayers[ i ] at the start of each loop iteration.

In eventSpawnedWithBomb, check that id is not equal to 0 (or make the alive check before has weapon check).

PHP Code:
            formatexmenuformatcharsmaxmenuformat ), "%s"bombsite] );
            
menu_additemmenumenuformat ); 
You don't format anything here, use rather :

PHP Code:
            menu_additemmenubombsite] ); 
I think it's all.
Done. Updated v1.3.

Quote:
Originally Posted by Mordekay View Post
Neat
Code:
[de]
MENU_TITLE = Ich werde die Bombe platzieren auf ...
PLANT_ON = Dein Kamerad will die Bombe auf %s platzieren! Schuetze ihn!
ILL_PLANT_ON = Ich werde die Bombe auf %s platzieren, schuetze mich!
Thank you!

Quote:
Originally Posted by alonelive View Post
Can you made this plugin like follows:

When a player starts to lay a bomb, a chat message will be written "player sets the C4 on A|B. And a radio-message "Cover me".
It's not the purpose of my plugin, sorry.
__________________
Kidev is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-14-2011 , 12:59   Re: I'll plant the bomb on...
Reply With Quote #10

PHP Code:
    while( ( target find_ent_by_classtargetclassnames[0] ) ) || ( target find_ent_by_classtargetclassnames[1] ) ) )
        
i++; 
This will enter in an infinite loop.

->

PHP Code:
    if( !find_ent_by_class( -1"func_bomb_target" ) && !find_ent_by_class( -1"info_bomb_target" ) )
        
pause("a"); 

Don't return any value in plugin_init.


PHP Code:
    if( ( !is_user_aliveid ) ) || ( !user_has_weaponidCSW_C4 ) ) ) return PLUGIN_HANDLED;
    else { 
Not really important, but you don't need else statement if you return at previous checks.
Would be same to reverse checks (if is_user_alive and user_has_weapon) and put following code into block.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-14-2011 at 13:03.
ConnorMcLeod 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 12:50.


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