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

|CSGO| Custom RoundEndOverlay > Round Draw


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 04-05-2018 , 11:07   |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #1

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!!
__________________
ateszhun95 is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 04-08-2018 , 22:45   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #2

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
Attached Files
File Type: sp Get Plugin or Get Source (round_end_overlay.sp - 647 views - 2.5 KB)
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118

Last edited by rogeraabbccdd; 04-10-2018 at 20:15. Reason: Update
rogeraabbccdd is offline
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 04-09-2018 , 17:45   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #3

Thank you for your time

Unfortunately i got server crash when loading the plugin :/
__________________
ateszhun95 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 04-10-2018 , 00:49   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #4

Quote:
Originally Posted by ateszhun95 View Post
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.
Drixevel is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 04-10-2018 , 01:15   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #5

Updated.
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-10-2018 , 04:41   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #6

You don't want to re-add the FCVAR_CHEAT flag?
__________________
Silvers is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 04-10-2018 , 10:06   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #7

Updated, tested in game and works fine.

Quote:
Originally Posted by Silvers View Post
You don't want to re-add the FCVAR_CHEAT flag?
It's unnecessary.
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 04-11-2018 , 06:12   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #8

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?
__________________
ateszhun95 is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 04-11-2018 , 06:26   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #9

Quote:
Originally Posted by ateszhun95 View Post
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"
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118

Last edited by rogeraabbccdd; 04-11-2018 at 06:27.
rogeraabbccdd is offline
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 04-14-2018 , 04:49   Re: |CSGO| Custom RoundEndOverlay > Round Draw
Reply With Quote #10

Quote:
Originally Posted by rogeraabbccdd View Post
It should be "overlays/custom/imperiumcsgo"
Not working for me :/ Tested with own overlay file and also with any working cs go overlay :/
__________________
ateszhun95 is offline
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 07:10.


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