Hello! I'm trying to create a custom overlay for CSGO.
This is the code:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include < sourcemod >
#include < sdktools >
#define PLUGIN "New Plug-In"
#define VERSION "0.Ox"
#define AUTHOR "Hades Ownage"
#define DESC "Description here.."
#define URL "http://extreamcs.com/forum"
#define OVERLAY_PATH "overlays/pulamea"
public Plugin:myinfo = {
name = PLUGIN,
author = AUTHOR,
description = DESC,
version = VERSION,
url = URL
};
public OnPluginStart ( ) {
CreateConVar ( "sm_name_version", VERSION, "Name Version", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
RegConsoleCmd ( "sm_overlay", OverlayCommand );
}
public Action: OverlayCommand ( client, args ) {
new String: vtfbuffer [ 128 ];
FormatEx ( vtfbuffer, sizeof ( vtfbuffer ), "%s.vtf", OVERLAY_PATH );
ShowOverlayToClient ( client, vtfbuffer );
}
public OnMapStart ( ) {
new String: vtfbuffer [ 128 ], String: vmtbuffer [ 128 ];
new String: vtfbuffer2 [ 128 ], String: vmtbuffer2 [ 128 ];
FormatEx ( vtfbuffer, sizeof ( vtfbuffer ), "%s.vtf", OVERLAY_PATH );
FormatEx ( vmtbuffer, sizeof ( vmtbuffer ), "%s.vmt", OVERLAY_PATH );
FormatEx ( vtfbuffer2, sizeof ( vtfbuffer2 ), "materials/%s.vtf", OVERLAY_PATH );
FormatEx ( vmtbuffer2, sizeof ( vmtbuffer2 ), "materials/%s.vmt", OVERLAY_PATH );
PrecacheDecal ( vtfbuffer );
PrecacheDecal ( vmtbuffer );
AddFileToDownloadsTable ( vtfbuffer2 );
AddFileToDownloadsTable ( vmtbuffer2 );
}
stock ShowOverlayToClient(client, const String:overlaypath[])
{
ClientCommand(client, "r_screenoverlay \"%s\"", overlaypath);
}
stock ShowOverlayToAll(const String:overlaypath[])
{
// x = client index.
for (new x = 1; x <= MaxClients; x++)
{
// If client isn't in-game, then stop.
if (IsClientInGame(x) && !IsFakeClient(x))
{
ShowOverlayToClient(x, overlaypath);
}
}
}
Good, the code works fine but the problem is the VTF/VMT file.
I successfully create the VTF and VMT file with an custom text (test) and with transparent background.
The VMT file is like that:
PHP Code:
"$basetexture" "overlays/pulamea"
"$translucent" 1
"$additive" 1
But the result is that:
Why is flashing ?
Thank you!