Raised This Month: $ Target: $400
 0% 

C4 plant delay [Updated 01/15/2017] v1.3


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff       
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-12-2016 , 13:41   C4 plant delay [Updated 01/15/2017] v1.3
Reply With Quote #1

C4 PLANT DELAY v1.3


- Description
This plugin block the bomb plant until the minimum time for plant ends.
But whats the difference between others?

That version, the hud appear only when you have the c4 in hands. When you switch to other weapon, the hud disappear.

- Cvars
cpd_delay 60 - Time you should wait for plant the bomb

- How to install?
1. c4_plant_delay.sma - addons/amxmodx/scripting
2. c4_plant_delay.amxx - addons/amxmodx/plugins
3. c4_plant_delay.txt - addons/amxmodx/data/lang

- Credits
Bugsy - For the code

- Change Log
Spoiler

- Translations

[en] - Myself
[bp] - Myself
[pt] - Myself
[cz] - Myself
[sk] - Myself
[rs] - Artifact
Attached Files
File Type: sma Get Plugin or Get Source (C4_plant_delay.sma - 959 views - 2.0 KB)
File Type: txt cpd_translation.txt (331 Bytes, 265 views)

Last edited by EFFx; 01-15-2017 at 17:04.
EFFx is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-12-2016 , 21:19   Re: C4 plant delay [Updated 03/12/2016]
Reply With Quote #2

Not bad
__________________
Artifact is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-12-2016 , 21:34   Re: C4 plant delay [Updated 03/12/2016]
Reply With Quote #3

Quote:
Originally Posted by Artifact View Post
Not bad
Thanks.

Last edited by EFFx; 03-12-2016 at 21:34.
EFFx is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-13-2016 , 16:38   Re: C4 plant delay [Updated 03/12/2016]
Reply With Quote #4

I did a little work on this for you
PHP Code:

#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "C4 plant delay"
#define VERSION "1.0"
#define AUTHOR "EFFx"

new g_HoldingC4 g_HUDSync g_RoundStartTime g_pCvarDelay;

public 
plugin_init() 
{
    
register_pluginPLUGIN VERSION AUTHOR );
    
    
register_event"HLTV" "RoundStart" "a" "1=0" "2=0" );
    
register_event"CurWeapon" "SwitchToC4" "be" "1=1" "2=6" );
    
register_event"CurWeapon" "SwitchToOther" "be" "1=1" "2!6" );
    
    
g_pCvarDelay register_cvar"cpd_delay" "20" );
    
    
RegisterHamHam_Weapon_PrimaryAttack "weapon_c4" "ham_PrimaryAttack_C4" );
    
    
g_HUDSync CreateHudSyncObj();
    
g_RoundStartTime get_systime();
}

public 
RoundStartid )
{
    
g_RoundStartTime get_systime();
    
g_HoldingC4 0;


public 
SwitchToC4id )
{
    new 
iDelay get_pcvar_numg_pCvarDelay );
    
    if ( !( 
g_HoldingC4 & ( << ( id 31 ) ) ) && ( ( get_systime() - g_RoundStartTime ) < iDelay ) )
    {
        
set_task1.0 "ShowHUD" id , .flags="a" , .repeat=( iDelay - ( get_systime() - g_RoundStartTime ) ) - ); 
        
g_HoldingC4 |= ( << ( id 31 ) );
    }
}

public 
SwitchToOtherid )
{
    if ( 
g_HoldingC4 & ( << ( id 31 ) ) )
    {
        
ClearSyncHudid g_HUDSync );
        
remove_taskid );
        
g_HoldingC4 &= ~( << ( id 31 ) );
    }
}

public 
ShowHUDid )
{
    new 
szHud40 ];
    
    
formatexszHud charsmaxszHud ) ,"You need wait %i seconds for plant!" get_pcvar_numg_pCvarDelay ) - ( get_systime() - g_RoundStartTime ) );
    
set_hudmessage220 80 000 , -1.0 0.16 1.0 1.0 );
    
ShowSyncHudMsgid g_HUDSync,szHud );
}

public 
ham_PrimaryAttack_C4iEnt 
{    
    return ( ( 
get_systime() - g_RoundStartTime ) <= get_pcvar_numg_pCvarDelay ) ) ? HAM_SUPERCEDE HAM_IGNORED;

__________________

Last edited by Bugsy; 03-13-2016 at 16:45.
Bugsy is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-13-2016 , 16:49   Re: C4 plant delay [Updated 03/12/2016]
Reply With Quote #5

You're awesome.
I'll add your credit.

Updated to v1.2

Last edited by EFFx; 03-13-2016 at 17:07.
EFFx is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-13-2016 , 16:54   Re: C4 plant delay [Updated 03/12/2016]
Reply With Quote #6

I don't care, it's your plugin. Just review it and compare to yours to see what stuff I changed and ask questions if you have any.
__________________
Bugsy is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 03-13-2016 , 20:27   Re: C4 plant delay [Updated 03/13/2016] v1.2
Reply With Quote #7

[RS]
MESSAGE_C4 = Moras sacekati %i sekundi pre nego sto platas bombu!
__________________
Artifact is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-13-2016 , 20:35   Re: C4 plant delay [Updated 03/13/2016] v1.2
Reply With Quote #8

Quote:
Originally Posted by Artifact View Post
[RS]
MESSAGE_C4 = Moras sacekati %i sekundi pre nego sto platas bombu!

Thank you, updated.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-18-2016 , 10:08   Re: C4 plant delay [Updated 03/13/2016] v1.2
Reply With Quote #9

I see that you just took bugsy plugin and released it. Do you understand the code? Are you able to support it?
__________________
HamletEagle is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-18-2016 , 16:36   Re: C4 plant delay [Updated 03/13/2016] v1.2
Reply With Quote #10

I made my code. But bugsy gave for me your best code.
And i can support more or less the code. Because im not "pro" in plugins.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 08:34.


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