PHP Code:
#include <sdktools>
// Directory to VTF & VMT file
char g_sOverlay[PLATFORM_MAX_PATH] = "overlays/logo";
#pragma newdecls required
public Plugin myinfo =
{
name = "Overlay",
author = "Bobakanoosh",
description = "Overlays a picture to all clients",
version = "1.0.0",
url = ""
};
public void OnPluginStart() {
}
public void OnMapStart() {
char sBuffer[PLATFORM_MAX_PATH];
Format(sBuffer, sizeof(sBuffer), "materials/%s.vmt", g_sOverlay);
AddFileToDownloadsTable(sBuffer);
Format(sBuffer, sizeof(sBuffer), "materials/%s.vtf", g_sOverlay);
AddFileToDownloadsTable(sBuffer);
PrecacheDecal(g_sOverlay, true);
}
public void OnClientPostAdminCheck(int client) {
if (client < 1 || client > MaxClients)
return;
ShowOverlayToClient(client, g_sOverlay);
}
stock void ShowOverlayToClient(int client, const char[] overlaypath) {
int iFlags = GetCommandFlags("r_screenoverlay");
SetCommandFlags("r_screenoverlay", iFlags &~ FCVAR_CHEAT);
ClientCommand(client, "r_screenoverlay \"%s\"", overlaypath);
SetCommandFlags("r_screenoverlay", iFlags);
}
Should work, you will need to create a Valve Texture File (VTF, try VTFEdit software), along with a VMT.
My VMT file looks like:
PHP Code:
"UnlitGeneric"
{
"$basetexture" "overlays/cq/ct_win"
"$translucent" 1
}
And make sure to upload it to a fastdl server so your players can download it.