AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   |CSGO| Custom RoundEndOverlay > Round Draw (https://forums.alliedmods.net/showthread.php?t=306560)

ateszhun95 04-05-2018 11:07

|CSGO| Custom RoundEndOverlay > Round Draw
 
Hello,

Is there a plugin what can display custom overlay if RoundDraw? I would like a plugin like that on my surf deathmatch server.

Thank you for future.

Have a nice day!!:)

rogeraabbccdd 04-08-2018 22:45

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
1 Attachment(s)
PHP Code:

#include <sourcemod> 
#include <sdktools> 

#pragma newdecls required 

ConVar Cvar_OverlayCvar_Time;

char overlay_path[PLATFORM_MAX_PATH];
float overlay_time;

public 
Plugin myinfo =   

    
name "[CS:GO] Round Draw Overlay",  
    
author "Kento",  
    
description "Display overlay when round draw.",  
    
version "1.0",  
    
url "http://steamcommunity.com/id/kentomatoryoshika/" 
}; 

public 
void OnPluginStart() 

    
HookEvent("round_end"Event_RoundEnd); 
    
    
Cvar_Overlay CreateConVar("sm_overlay""""Overlay to display, no need to add materials folder and vmt, vtf here."); 
    
Cvar_Time CreateConVar("sm_overlay_time""5.0""How long should overlay display?"); 
    
    
AutoExecConfig();


public 
void OnConfigsExecuted()
{
    
Cvar_Overlay.GetString(overlay_pathsizeof(overlay_path));
    
overlay_time Cvar_Time.FloatValue;
}

public 
void OnMapStart() 

    if(!
StrEqual(overlay_path""))
    {
        
char dlpath1[1024], dlpath2[1024];
        
Format(dlpath1sizeof(dlpath1), "materials/%s.vtf"overlay_path);
        
Format(dlpath2sizeof(dlpath2), "materials/%s.vmt"overlay_path);
        
AddFileToDownloadsTable(dlpath1);
        
AddFileToDownloadsTable(dlpath2);
        
PrecacheDecal(dlpath1true); 
        
PrecacheDecal(dlpath2true); 
    }


public 
Action Event_RoundEnd(Handle event, const char[] namebool dontBroadcast

    
char message[256]; 
    
GetEventString(event"message"messagesizeof(message));
    if(
StrEqual(message"#SFUI_Notice_Round_Draw"false))
    {
        for (
int i 1<= MaxClientsi++) 
        {
            if (
IsValidClient(i) && !IsFakeClient(i)) 
            {
                
SetClientOverlay(ioverlay_path);
                
CreateTimer(overlay_timeDeleteOverlayi);
            }
        }
    }


stock bool IsValidClient(int client

    if (
client <= 0) return false
    if (
client MaxClients) return false
    if (!
IsClientConnected(client)) return false
    return 
IsClientInGame(client); 


// Code taken from csgoware  
// https://forums.alliedmods.net/showthread.php?p=2500764 
bool SetClientOverlay(int clientchar[] strOverlay

    if (
IsValidClient(client) && !IsFakeClient(client)) 
    { 
        
//int iFlags = GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT); 
        //SetCommandFlags("r_screenoverlay", iFlags);  
        
ClientCommand(client"r_screenoverlay \"%s\""strOverlay); 
        return 
true
    } 
    return 
false


public 
Action DeleteOverlay(Handle tmrany client

    if (
IsValidClient(client) && !IsFakeClient(client)) 
    { 
        
SetClientOverlay(client""); 
    } 
    return 
Plugin_Handled


Also available on Github

ateszhun95 04-09-2018 17:45

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
Thank you for your time :)

Unfortunately i got server crash when loading the plugin :/

Drixevel 04-10-2018 00:49

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
Quote:

Originally Posted by ateszhun95 (Post 2586963)
Thank you for your time :)

Unfortunately i got server crash when loading the plugin :/

You need to fill the convar for the decal, it's trying to precache an empty string right now.

rogeraabbccdd 04-10-2018 01:15

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
Updated.

Silvers 04-10-2018 04:41

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
You don't want to re-add the FCVAR_CHEAT flag?

rogeraabbccdd 04-10-2018 10:06

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
Updated, tested in game and works fine.

Quote:

Originally Posted by Silvers (Post 2587007)
You don't want to re-add the FCVAR_CHEAT flag?

It's unnecessary.

ateszhun95 04-11-2018 06:12

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
Recompiled by this: "sm_overlay", "materials/overlays/custom/imperium"

My files are:

materials/overlays/custom/imperium/imperiumcsgo.vmt
materials/overlays/custom/imperium/imperiumcsgo.vtf

At round end is nothing :/

What am i doing wrong?

rogeraabbccdd 04-11-2018 06:26

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
Quote:

Originally Posted by ateszhun95 (Post 2587183)
Recompiled by this: "sm_overlay", "materials/overlays/custom/imperium"

My files are:

materials/overlays/custom/imperium/imperiumcsgo.vmt
materials/overlays/custom/imperium/imperiumcsgo.vtf

At round end is nothing :/

What am i doing wrong?

It should be "overlays/custom/imperiumcsgo"

ateszhun95 04-14-2018 04:49

Re: |CSGO| Custom RoundEndOverlay > Round Draw
 
Quote:

Originally Posted by rogeraabbccdd (Post 2587184)
It should be "overlays/custom/imperiumcsgo"

Not working for me :/ Tested with own overlay file and also with any working cs go overlay :/


All times are GMT -4. The time now is 20:33.

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