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

Solved [CSGO]Looking for Plugin Bombs countdown


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 02-07-2023 , 12:32   [CSGO]Looking for Plugin Bombs countdown
Reply With Quote #1

Hi I'm looking for a plugin that will only show the bomb countdown on the hud like in the picture below, when it zaps it immediately the time flies and that the countdown is in the same place as in the picture.

preferably there would be colors like this:
45-20s = Green
20-10s = Yellow
10-0s = Red
Attached Thumbnails
Click image for larger version

Name:	screenshot_1.JPG
Views:	87
Size:	11.7 KB
ID:	199495   Click image for larger version

Name:	screenshot_2.JPG
Views:	67
Size:	10.4 KB
ID:	199496  

Last edited by Danielej1; 02-08-2023 at 12:57.
Danielej1 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 02-08-2023 , 04:45   Re: [CSGO]Looking for Plugin Bombs countdown
Reply With Quote #2

Took this plugin and modified it to add a hud sync as well: https://forums.alliedmods.net/showthread.php?p=1934836

(untested)
Attached Files
File Type: sp Get Plugin or Get Source (advancedc4timer.sp - 107 views - 17.8 KB)

Last edited by Drixevel; 02-08-2023 at 23:04.
Drixevel is offline
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 02-08-2023 , 09:22   Re: [CSGO]Looking for Plugin Bombs countdown
Reply With Quote #3

bugs
Code:
L 02/08/2023 - 15:21:45: [basecommands.smx] "✪⭕⃤ | Danielek | ⭕⃤<77><STEAM_1:0:149379100><>" console command (cmdline "sm plugins load advancedc4timer")
L 02/08/2023 - 15:21:45: [SM] Fatal error encountered parsing translation file "plugin.advancedc4timer.txt"
L 02/08/2023 - 15:21:45: [SM] Error (line 0, column 0): Stream failed to open
L 02/08/2023 - 15:21:45: [SM] Exception reported: Invalid Cookie handle 0 (error 4)
L 02/08/2023 - 15:21:45: [SM] Blaming: advancedc4timer.smx
L 02/08/2023 - 15:21:45: [SM] Call stack trace:
L 02/08/2023 - 15:21:45: [SM] [0] SetClientCookie
L 02/08/2023 - 15:21:45: [SM] [1] Line 289, /home/forums/content/files/5/9/6/9/4/199515.attach::LoadClientData
L 02/08/2023 - 15:21:45: [SM] [2] Line 211, /home/forums/content/files/5/9/6/9/4/199515.attach::OnPluginStart
L 02/08/2023 - 15:21:45: [SM] [4] ServerCommandEx
L 02/08/2023 - 15:21:45: [SM] [5] Line 402, /home/builds/sourcemod/debian9-1.12/build/plugins/basecommands.sp::Command_Rcon
[SM] Plugin advancedc4timer.smx failed to load: Error detected in plugin startup (see error logs).
Danielej1 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 02-08-2023 , 10:15   Re: [CSGO]Looking for Plugin Bombs countdown
Reply With Quote #4

PHP Code:
#pragma semicolon 1
#pragma newdecls required

static const int
    CLR
[] = {0xFF000xFFBF000xFF0000};
static const 
float
    HUD
[] = {-1.00.850.1}; // x, y, time

Handle
    hHUD
,
    
hTimer;
float
    fTime 
45.0,
    
fStart;

public 
void OnPluginStart()
{
    
ConVar cvar FindConVar("mp_c4timer");
    if(
cvar)
    {
        
fTime cvar.FloatValue;
        
cvar.AddChangeHook(CVarChange);
    }

    
hHUD CreateHudSynchronizer();

    
HookEvent("bomb_planted"Event_BombEventHookMode_PostNoCopy);
    
HookEvent("round_start"Event_BombEventHookMode_PostNoCopy);
    
HookEvent("bomb_exploded"Event_BombEventHookMode_PostNoCopy);
    
HookEvent("bomb_defused"Event_BombEventHookMode_PostNoCopy);
}

public 
void CVarChange(ConVar cvar, const char[] oldValue, const char[] newValue)
{
    
fTime cvar.FloatValue;
}

public 
void OnMapStart()
{
    if(
hTimerdelete hTimer;
}

public 
void OnMapEnd()
{
    
OnMapStart();
}

public 
void Event_Bomb(Event event, const char[] namebool dontBroadcast)
{
    
OnMapStart();
    if(
name[5] != 'p')
        return;

    
fStart GetGameTime();
    
hTimer CreateTimer(HUD[2], Timer_Countdown_TIMER_REPEAT);
    
Timer_Countdown(null);
}

public 
Action Timer_Countdown(Handle timer)
{
    
float time fStart fTime GetGameTime();
    if(
time 0.1)
    {
        
hTimer null;
        return 
Plugin_Stop;
    }

    
int type;
    if(
time <= 10)
        
type 2;
    else if(
time <= 20)
        
type 1;

    static 
char txt[32];
    
FormatEx(txtsizeof(txt), "C4: %.1f"time);
    
SetHudTextParams(HUD[0], HUD[1], HUD[2] + 0.1, (CLR[type] & 0xFF0000) >> 16, (CLR[type] & 0xFF00) >> 8CLR[type] & 0xFF25600.00.00.0);
    for(
int i 1<= MaxClientsi++) if(IsClientInGame(i)) ShowSyncHudText(ihHUDtxt);

    return 
Plugin_Continue;

__________________

Last edited by Grey83; 02-08-2023 at 10:15.
Grey83 is offline
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 02-08-2023 , 12:57   Re: [CSGO]Looking for Plugin Bombs countdown
Reply With Quote #5

Thank u Grey
Danielej1 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 02-08-2023 , 23:05   Re: [CSGO]Looking for Plugin Bombs countdown
Reply With Quote #6

Quote:
Originally Posted by Danielej1 View Post
bugs
Code:
L 02/08/2023 - 15:21:45: [basecommands.smx] "✪⭕⃤ | Danielek | ⭕⃤<77><STEAM_1:0:149379100><>" console command (cmdline "sm plugins load advancedc4timer")
L 02/08/2023 - 15:21:45: [SM] Fatal error encountered parsing translation file "plugin.advancedc4timer.txt"
L 02/08/2023 - 15:21:45: [SM] Error (line 0, column 0): Stream failed to open
L 02/08/2023 - 15:21:45: [SM] Exception reported: Invalid Cookie handle 0 (error 4)
L 02/08/2023 - 15:21:45: [SM] Blaming: advancedc4timer.smx
L 02/08/2023 - 15:21:45: [SM] Call stack trace:
L 02/08/2023 - 15:21:45: [SM] [0] SetClientCookie
L 02/08/2023 - 15:21:45: [SM] [1] Line 289, /home/forums/content/files/5/9/6/9/4/199515.attach::LoadClientData
L 02/08/2023 - 15:21:45: [SM] [2] Line 211, /home/forums/content/files/5/9/6/9/4/199515.attach::OnPluginStart
L 02/08/2023 - 15:21:45: [SM] [4] ServerCommandEx
L 02/08/2023 - 15:21:45: [SM] [5] Line 402, /home/builds/sourcemod/debian9-1.12/build/plugins/basecommands.sp::Command_Rcon
[SM] Plugin advancedc4timer.smx failed to load: Error detected in plugin startup (see error logs).
Fixed the 2nd bug anyways, 1st one is because you didn't have the translation file for the plugin.
Drixevel 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 19:31.


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