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

Serverside overlays


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 05-31-2017 , 02:51   Serverside overlays
Reply With Quote #1

I was curious if anyone knew an extension that allows for custom overlays to be displayed to clients?

Also do server side overlays go in

root/overlays/...
or
root/overlay/...
Halt is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-31-2017 , 05:59   Re: Serverside overlays
Reply With Quote #2

There is no such thing as a server-side overlay, the concept doesn't even make sense - the server doesn't draw anything.
__________________
asherkin is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 05-31-2017 , 07:48   Re: Serverside overlays
Reply With Quote #3

PHP Code:
int iFlags GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT);
SetCommandFlags("r_screenoverlay"iFlags);    
ClientCommand(client"r_screenoverlay \"your_overlay\"", ); 
__________________

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
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 05-31-2017 , 07:56   Re: Serverside overlays
Reply With Quote #4

you can use these stocks I made:

https://github.com/shanapu/MyJailbre...e/mystocks.inc
PHP Code:
// Easy precache & prepare download for decals
stock void PrecacheDecalAnyDownload(char[] sDecal)
{
    
char sBuffer[256];
    
Format(sBuffersizeof(sBuffer), "%s.vmt"sDecal);
    
PrecacheDecal(sBuffertrue);
    
Format(sBuffersizeof(sBuffer), "materials/%s.vmt"sDecal);
    
AddFileToDownloadsTable(sBuffer);
    
    
Format(sBuffersizeof(sBuffer), "%s.vtf"sDecal);
    
PrecacheDecal(sBuffertrue);
    
Format(sBuffersizeof(sBuffer), "materials/%s.vtf"sDecal);
    
AddFileToDownloadsTable(sBuffer);
}

// Easy show overlay to a client with lifetime | 0.0 = no auto remove
stock void ShowOverlay(int clientchar[] pathfloat lifetime)
{
    if (
IsValidClient(clientfalsetrue))
    {
        
int iFlag GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT);
        
SetCommandFlags("r_screenoverlay"iFlag);
        
ClientCommand(client"r_screenoverlay \"%s.vtf\""path);
        if (
lifetime != 0.0CreateTimer(lifetimeDeleteOverlayclient);
    }
}

// Easy show overlay to all clients with lifetime | 0.0 = no auto remove
stock void ShowOverlayAll(char[] pathfloat deletetime
{
    for (
int i 1<= MaxClientsi++) if (IsValidClient(ifalsetrue))
    {
        
int iFlag GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT);
        
SetCommandFlags("r_screenoverlay"iFlag);
        
ClientCommand(i"r_screenoverlay \"%s.vtf\""path);
        if (
deletetime != 0.0CreateTimer(deletetimeDeleteOverlayi);
    }
}

// Remove overlay from a client
stock Action DeleteOverlay(Handle timerany client
{
    if (
IsValidClient(clientfalsetrue))
    {
        
int iFlag GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT);
        
SetCommandFlags("r_screenoverlay"iFlag);
        
ClientCommand(client"r_screenoverlay \"\"");
    }

__________________
coding & free software
shanapu is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 05-31-2017 , 11:16   Re: Serverside overlays
Reply With Quote #5

Quote:
Originally Posted by shanapu View Post
you can use these stocks I made:

https://github.com/shanapu/MyJailbre...e/mystocks.inc
PHP Code:
// Easy precache & prepare download for decals
stock void PrecacheDecalAnyDownload(char[] sDecal)
{
    
char sBuffer[256];
    
Format(sBuffersizeof(sBuffer), "%s.vmt"sDecal);
    
PrecacheDecal(sBuffertrue);
    
Format(sBuffersizeof(sBuffer), "materials/%s.vmt"sDecal);
    
AddFileToDownloadsTable(sBuffer);
    
    
Format(sBuffersizeof(sBuffer), "%s.vtf"sDecal);
    
PrecacheDecal(sBuffertrue);
    
Format(sBuffersizeof(sBuffer), "materials/%s.vtf"sDecal);
    
AddFileToDownloadsTable(sBuffer);
}

// Easy show overlay to a client with lifetime | 0.0 = no auto remove
stock void ShowOverlay(int clientchar[] pathfloat lifetime)
{
    if (
IsValidClient(clientfalsetrue))
    {
        
int iFlag GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT);
        
SetCommandFlags("r_screenoverlay"iFlag);
        
ClientCommand(client"r_screenoverlay \"%s.vtf\""path);
        if (
lifetime != 0.0CreateTimer(lifetimeDeleteOverlayclient);
    }
}

// Easy show overlay to all clients with lifetime | 0.0 = no auto remove
stock void ShowOverlayAll(char[] pathfloat deletetime
{
    for (
int i 1<= MaxClientsi++) if (IsValidClient(ifalsetrue))
    {
        
int iFlag GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT);
        
SetCommandFlags("r_screenoverlay"iFlag);
        
ClientCommand(i"r_screenoverlay \"%s.vtf\""path);
        if (
deletetime != 0.0CreateTimer(deletetimeDeleteOverlayi);
    }
}

// Remove overlay from a client
stock Action DeleteOverlay(Handle timerany client
{
    if (
IsValidClient(clientfalsetrue))
    {
        
int iFlag GetCommandFlags("r_screenoverlay") & (~FCVAR_CHEAT);
        
SetCommandFlags("r_screenoverlay"iFlag);
        
ClientCommand(client"r_screenoverlay \"\"");
    }

Thanks man thats what I was looking for!
Halt 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