AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [CSGO]Looking for Plugin Bombs countdown (https://forums.alliedmods.net/showthread.php?t=341704)

Danielej1 02-07-2023 12:32

[CSGO]Looking for Plugin Bombs countdown
 
2 Attachment(s)
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

Drixevel 02-08-2023 04:45

Re: [CSGO]Looking for Plugin Bombs countdown
 
1 Attachment(s)
Took this plugin and modified it to add a hud sync as well: https://forums.alliedmods.net/showthread.php?p=1934836

:bee: (untested)

Danielej1 02-08-2023 09:22

Re: [CSGO]Looking for Plugin Bombs countdown
 
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).


Grey83 02-08-2023 10:15

Re: [CSGO]Looking for Plugin Bombs countdown
 
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;



Danielej1 02-08-2023 12:57

Re: [CSGO]Looking for Plugin Bombs countdown
 
Thank u Grey

Drixevel 02-08-2023 23:05

Re: [CSGO]Looking for Plugin Bombs countdown
 
Quote:

Originally Posted by Danielej1 (Post 2799055)
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.


All times are GMT -4. The time now is 11:46.

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