AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   I'll plant the bomb on... 2.3.0 - Let your team know where you'll plant (https://forums.alliedmods.net/showthread.php?t=159227)

Kidev 06-14-2011 09:28

I'll plant the bomb on... 2.3.0 - Let your team know where you'll plant
 
2 Attachment(s)
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

http://www.teamsaw.eu/images/btn_donate_LG.gif Current version (stable):

mohsen9010 06-14-2011 09:39

Re: I'll plant the bomb on...
 
nice :):):)

mohsen9010 06-14-2011 09:44

Re: I'll plant the bomb on...
 
can u answer my req ? http://forums.alliedmods.net/showthread.php?t=159228

alonelive 06-14-2011 11:22

Re: I'll plant the bomb on...
 
Does this plug-in the time interval between messages in the chat room and on the radio?
For flood control..

Kidev 06-14-2011 11:25

Re: I'll plant the bomb on...
 
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.

Mordekay 06-14-2011 11:31

Re: I'll plant the bomb on...
 
Neat :wink:
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


ConnorMcLeod 06-14-2011 11:38

Re: I'll plant the bomb on...
 
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.

alonelive 06-14-2011 11:40

Re: I'll plant the bomb on...
 
Quote:

Originally Posted by -Kid- (Post 1488106)
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".

Kidev 06-14-2011 12:46

Re: I'll plant the bomb on...
 
Quote:

Originally Posted by ConnorMcLeod (Post 1488119)
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 (Post 1488112)
Neat :wink:
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 (Post 1488123)
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.

ConnorMcLeod 06-14-2011 12:59

Re: I'll plant the bomb on...
 
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.


All times are GMT -4. The time now is 06:18.

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