Raised This Month: $171 Target: $400
 42% 

Realistic Defuse v1.4


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Hawk552 (427)
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-20-2009 , 20:37   Realistic Defuse v1.4
Reply With Quote #1

Hi, this is my second plugin...

Description:

This plugin give more realistic when the player (CT) defuse the bomb.

Features:

- You can block defusing without defuse kit (controled by cvar).
- You can set that defuse kit can be used only for some times (controled by cvar).
- Players can buy a New Defuse that can be used all the time except if you die (controled by cvar)
- Plugin Have Multilingual System.
- And more things.

Commands:
  • say /defuse: Show a menu asking you if want to buy a New Defuse, with the price too.
Cvars:
  • rd_enable (Default: 1)
    • 0: Plugin get paused.
    • 1: Plugin is working.
    • If you change this cvar in the middle of the game you have to change the map to apply the changes.
  • defuse_remove (Default: 1)
    • 0: Don't remove defuse kit from player when he defused the bomb.
    • 1: Remove defuse kit from player when he defused the bomb (see next cvar).
  • defuse_remove_immunity (Default: 0)
    • 0: Admins aren't inmune when defuse_remove cvar is enable.
    • 1: Admins are inmune when defuse_remove cvar is enable (so defuse not removed).
  • defuse_times (Default: 1)
    • How much defuses can be made after remove defuse kit from the player. defuse_remove have to be actived. 0 And 1 is the same.
  • defuse_block (Default: 1)
    • 0: Player can defuse without defuse kit.
    • 1: Player can't defuse without defuse kit.
  • defuse_block_immunity (Default: 0)
    • 0: Admins aren't inmune when defuse_block cvar is enable.
    • 1: Admins are inmune when defuse_block cvar is enable (so admins can defuse without defusekit).
  • defuse_reward (Default: 1)
    • 0: When the player defuse the bomb without defusekit, not get a reward.
    • 1: When the player defuse the bomb without defusekit, get a defuse (only if defuse_block is disabled).
  • defuse_plugintag (Default: "[Realistic Defusing]")
    • Change the Plugin Tag of the chat messages.
  • new_defuse (Default: "1")
    • 0: New Defuse is desactived.
    • 1: New Defuse is actived.
  • new_defuse_buyzone (Default: "1")
    • 0: Player can buy the New Defuse everywhere.
    • 1: Player can buy the New Defuse only in the buyzone.
  • new_defuse_sound (Default: "1")
    • 0: Don't play a sound.
    • 1|2|3: Play different sounds when you buy the New Defuse.
    • If the cvar have a value > than 0 and when you try to buy the New Defuse but don't have enough money you hear another sound (that can't be changed).
  • new_defuse_cost (Default: "1000")
    • Cost of the New Defuse.
  • new_defuse_color (Default: "255 0 0")
    • Color of the New Defuse to difference with the normal defuse.
Images:

[IMG]http://img7.**************/img7/5710/realisticdefusemenu.png[/IMG]

[IMG]http://img18.**************/img18/155/newdefuse.png[/IMG]

Recommended Plugins:

Icons Color Changer
Planting Normalizer
Time To Defuse
Drop Defuser Kit
Defuse Mistake 1.4

Credits:

Changelog:
  • Version 1.0
    • First Release.
  • Version 1.1
    • Cleaned code (click me).
    • Added print_center when you try to defuse without defuse kit (depends of defuse_block).
    • Added messages in the first spawn.
    • Added new cvar rd_enable to Enable/Disable (Unpause/Pause) the plugin.
  • Version 1.2
    • Minor cleaned code.
    • Fixed the bug with defuse_times cvar.
  • Version 1.3
    • Minor cleaned code.
    • Added new feature that take out the BuyZone icon when the menu is displayed(click me)
    • Added new cvar new_defuse_sound to play sounds when you buy the New Defuse and when you don't have enough money to buy it.
  • Version 1.4
    • Now it suposed that you can change defuse_time in the middle of the game without changing the map.
    • Added new cvars: defuse_remove_immunity, defuse_block_immunity, defuse_reward.
    • Also added some recommended plugins to the thread.
Multilingual:

Multilingual Thread: http://forums.alliedmods.net/showthread.php?t=101107

P.S: Plz correct me if i writed something wrong, my english is not perfect.
Attached Files
File Type: txt real_defuse.txt (5.5 KB, 1274 views)
File Type: sma Get Plugin or Get Source (realistic_defuse.sma - 2725 views - 6.9 KB)
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 09-22-2009 at 02:54. Reason: Update v1.4
Alucard^ is offline
Send a message via Skype™ to Alucard^
Old 08-20-2009, 22:39
Asd'
This message has been deleted by Asd'.
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-21-2009 , 00:48   Re: Realistic Defuse
Reply With Quote #2

Updated to v1.1

PHP Code:
new bool:CantDefuse[33]

public 
client_putinserver(id)
CantDefuse[id] = true

public C4Used(iC4ididactivatoruse_typeFloat:value)
{
    if(
use_type != || value != 1.0 || get_user_team(id) != 2)
        return 
HAM_IGNORED
    
    
if(cs_get_user_defuse(id) && !get_pcvar_num(p_BlockDefuse) )
    return 
HAM_IGNORED
    
    
if(CantDefuse[id])
        return 
HAM_SUPERCEDE
    
    
return HAM_IGNORED

--->

PHP Code:
public C4Used(iC4ididactivatoruse_typeFloat:value)
{
    if(
use_type != || value != 1.0 || get_user_team(id) != 2)
        return 
HAM_IGNORED
    
    
    
if(!cs_get_user_defuse(id) && get_pcvar_num(p_BlockDefuse) )
    {
        
client_print(idprint_center"%L"id"BD_MESSAGE"Tag)
        return 
HAM_SUPERCEDE
    
}
    
    return 
HAM_IGNORED

See the first post for more information about the update.

Also i have a new problem, dont know if is NEW at all but i tested a lot of times after release and work perfect =|

Here an example to explain the problem:

defuse_remove 1
defuse_times 1

The bomb has been planted, the player defuse the bomb, remove the defuse kit from the player. (This work perfect)

But the next round if the player buy defuse and he defuse the bomb, the defuse kit of the player don't get removed =/
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 08-21-2009 at 00:55.
Alucard^ is offline
Send a message via Skype™ to Alucard^
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-21-2009 , 00:59   Re: Realistic Defuse
Reply With Quote #3

Dont you need to set NewDefuse to true/false foe each player ? (or something i've misread in the code ?)
__________________
- tired and retired -
ConnorMcLeod is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-21-2009 , 01:24   Re: Realistic Defuse
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Dont you need to set NewDefuse to true/false foe each player ? (or something i've misread in the code ?)
Emm, i dont understand at all but... the problem isn't the NewDefuse, the problem is with the normal defuse.

PHP Code:
public bomb_defused(defuser)
{
    if(
get_pcvar_num(p_RemoveDefuse) && cs_get_user_defuse(defuser) )
    {    
        if(!
NewDefuse)
        {
            new 
num get_pcvar_num(p_Defuses)
            
            if( (++
Defuses == num) || get_pcvar_num(p_Defuses) == 0)
                
cs_set_user_defuse(defuser0)
        }
    }

This is how i detect how much defuses have to been made after remove defuse (remove defuse only if is a normal defuse, if is a New Defuse, dont remove it).

EDIT: Updated to 1.2

PHP Code:
public bomb_defused(defuser)
{
    if(
get_pcvar_num(p_RemoveDefuse) && cs_get_user_defuse(defuser) )
    {    
        if(!
NewDefuse)
        {
            new 
num get_pcvar_num(p_Defuses)
            
            if( (++
Defuses == num) || get_pcvar_num(p_Defuses) == 0)
                
cs_set_user_defuse(defuser0)
        }
    }

-->

PHP Code:
public bomb_defused(defuser)
{
    if(
get_pcvar_num(p_RemoveDefuse) && cs_get_user_defuse(defuser) && !NewDefuse)
    {    
        new 
num get_pcvar_num(p_Defuses)
        
        if( (++
Defuses == num) || get_pcvar_num(p_Defuses) == 0)
        {
            
cs_set_user_defuse(defuser0)
            
Defuses 0
        
}
    }

This is the better way to solved the problem?

Quote:
Originally Posted by Asd' View Post
You could upload screenshots, please?
I don't think are rly needed becouse the plugin has nothing special visual but well, added 2 images in the first post.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 08-21-2009 at 02:43.
Alucard^ is offline
Send a message via Skype™ to Alucard^
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-21-2009 , 04:49   Re: Realistic Defuse
Reply With Quote #5

Quote:
  • Version 1.3
    • Minor cleaned code.
    • Added new feature that take out the BuyZone icon when the menu is displayed(click me)
    • Added new cvar new_defuse_sound to play sounds when you buy the New Defuse and when you don't have enough money to buy it.
[IMG]http://img15.**************/img15/382/buyzoneicon.png[/IMG]

The way how i take out the BuyZone icon when the menu is displayed and come back when the menu is destroyed, is a good way? or can be optimized a lot?
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-21-2009 , 07:45   Re: Realistic Defuse v1.3
Reply With Quote #6

1. You got 2 English translations... [en] & [en], one of them needs to be [ro]
2. ND_DESACTIVED = [%s] The New Defuse is desactived (->deactivated) right now.
3. ND_RECIVED = [%s] You recived (-> received) a New Defuse.
4. Dutch here:

Quote:
[nl]
MENU_TITLE = \yWil je een Nieuwe Ontmijning kopen?
MENU_YES = \wJa
MENU_NO = \wNee
MENU_TEXT = \wDe kosten van de Nieuwe Ontmijning zijn \r$%i
ND_DESACTIVED = [%s] De Nieuwe Ontmijning is momenteel uitgeschakeld.
ND_HAS_DEFUSE = [%s] Je kan geen Nieuwe Ontmijning kopen want je hebt er reeds een.
ND_ALIVE = [%s] Je moet levend zijn om een Nieuwe Ontmanteling te kopen.
ND_T_CANT = [%s] De nieuwe ontmanteling is alleen voor CT's.
ND_BUYZONE = [%s] Je kan Nieuwe Ontmantelingen alleen kopen in de koopzone.
ND_MONEY = [%s] Je hebt niet genoeg geld om een Nieuwe Ontmanteling te kopen.
ND_RECIVED = [%s] Je kreeg een Nieuwe Ontmanteling.
ND_BUY_DEFUSE = [%s] Als je een Nieuwe Ontmanteling wilt kopen, schrijf dan /defuse.
BD_MESSAGE = [%s] Je kan de bom niet ontschadelijk maken zonder ontmijnings pakket.
SPAWN_MESSAGE = [%s] Schrijf /defuse om een Nieuwe Ontmanteling te kopen.
__________________

Last edited by crazyeffect; 08-21-2009 at 07:49.
crazyeffect is offline
Send a message via MSN to crazyeffect
Old 08-21-2009, 07:48
xPaw
This message has been deleted by xPaw. Reason: fix'dz0r``
Old 08-21-2009, 07:49
crazyeffect
This message has been deleted by crazyeffect. Reason: Fixed
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-27-2009 , 08:01   Re: Realistic Defuse v1.4
Reply With Quote #7

Quote:
Version 1.4
  • Now it suposed that you can change defuse_time in the middle of the game without changing the map.
  • Added new cvars: defuse_remove_immunity, defuse_block_immunity, defuse_reward.
  • Also added some recommended plugins to the thread.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-06-2009 , 15:27   Re: Realistic Defuse v1.4
Reply With Quote #8

This plugin is well done.

If you would like any information regarding possible adjustments you could make or things you could do to make this better, please feel free to post here or PM me.

Approved.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-22-2009 , 04:57   Re: Realistic Defuse v1.4
Reply With Quote #9

A small suggestion for realism, you can't defuse when you're fully blinded... because you just can't see what you do there xD you should be allowed to start defusing after flash becomes transparent.
__________________
Hunter-Digital is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-22-2009 , 06:25   Re: Realistic Defuse v1.4
Reply With Quote #10

Good Suggestion, thx... i will add this.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 05:43.


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