AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   Serverside overlays (https://forums.alliedmods.net/showthread.php?t=298059)

Halt 05-31-2017 02:51

Serverside overlays
 
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/...

asherkin 05-31-2017 05:59

Re: Serverside overlays
 
There is no such thing as a server-side overlay, the concept doesn't even make sense - the server doesn't draw anything.

rogeraabbccdd 05-31-2017 07:48

Re: Serverside overlays
 
PHP Code:

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


shanapu 05-31-2017 07:56

Re: Serverside overlays
 
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 \"\"");
    }



Halt 05-31-2017 11:16

Re: Serverside overlays
 
Quote:

Originally Posted by shanapu (Post 2524923)
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!


All times are GMT -4. The time now is 01:17.

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