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

[SLVD] Create custom overlay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 11-08-2015 , 16:23   [SLVD] Create custom overlay
Reply With Quote #1

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 
ActionOverlayCommand clientargs ) {
    
    new 
Stringvtfbuffer 128 ];
    
FormatEx vtfbuffersizeof vtfbuffer ), "%s.vtf"OVERLAY_PATH );
    
ShowOverlayToClient clientvtfbuffer );

}

public 
OnMapStart ( ) {

    new 
Stringvtfbuffer 128 ], Stringvmtbuffer 128 ];
    new 
Stringvtfbuffer2 128 ], Stringvmtbuffer2 128 ];

    
FormatEx vtfbuffersizeof vtfbuffer ), "%s.vtf"OVERLAY_PATH );
    
FormatEx vmtbuffersizeof vmtbuffer ), "%s.vmt"OVERLAY_PATH );

    
FormatEx vtfbuffer2sizeof vtfbuffer2 ), "materials/%s.vtf"OVERLAY_PATH );
    
FormatEx vmtbuffer2sizeof 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 1<= MaxClientsx++)
    {
        
// If client isn't in-game, then stop.
        
if (IsClientInGame(x) && !IsFakeClient(x))
        {
            
ShowOverlayToClient(xoverlaypath);
        }
    }

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"
"
$translucent1
"$additive
But the result is that:


Why is flashing ?

Thank you!

Last edited by hadesownage; 11-08-2015 at 16:45. Reason: Solved
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 11-08-2015 , 16:31   Re: Create custom overlay
Reply With Quote #2

Try material as "UnlitGeneric"
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 11-08-2015 , 16:41   Re: Create custom overlay
Reply With Quote #3

Quote:
Originally Posted by KissLick View Post
Try material as "UnlitGeneric"
Thank you, i solved the problem with your help!
But the text is a little bit transparent, why ?
http://puu.sh/leq18.jpg

FIXED: I removed the "$additive" 1

Last edited by hadesownage; 11-08-2015 at 16:45.
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
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 10:58.


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