Raised This Month: $ Target: $400
 0% 

[CS:GO] Headshot Overlay help :)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
m22b
Senior Member
Join Date: Jul 2013
Old 02-19-2015 , 08:19   [CS:GO] Headshot Overlay help :)
Reply With Quote #1

PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1

#define PLUGIN_VERSION     "1"

new Handle:sm_headshot              INVALID_HANDLE;
new 
Handle:sm_headshot_overlay_version         INVALID_HANDLE;

public 
Plugin:myinfo =
{
    
name "CSVK.RU Over",
    
author "csvk.ru",
    
description "csvk.ru",
    
version PLUGIN_VERSION,
    
url "csvk.ru"
};

public 
OnPluginStart()
{
    
// Hook events
    
HookEvent("player_death"player_death);

    
// Create convars
    
sm_headshot CreateConVar("sm_headshot""csvk_kill/headshot""Patch to overlay");
    
sm_headshot_overlay_version CreateConVar("sm_headshot_overlay_version"PLUGIN_VERSION"Headshot overlay version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
HookConVarChange(sm_headshot_overlay_versionVersionChange);
}

public 
VersionChange(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
SetConVarString(convarPLUGIN_VERSION);
}

public 
OnMapStart()
{
    
decl String:file[256];
    
BuildPath(Path_SMfile255"configs/headshot_downloads.ini");
    new 
Handle:fileh OpenFile(file"r");
    if (
fileh != INVALID_HANDLE)
    {
        
decl String:buffer[256];
        
decl String:buffer_full[PLATFORM_MAX_PATH];

        while(
ReadFileLine(filehbuffersizeof(buffer)))
        {
            
TrimString(buffer);
            if ( (
StrContains(buffer"//") == -1) && (!StrEqual(buffer"")) )
            {
                
PrintToServer("Reading overlay_downloads line :: %s"buffer);
                
Format(buffer_fullsizeof(buffer_full), "materials/%s"buffer);
                if (
FileExists(buffer_full))
                {
                    
PrintToServer("Precaching %s"buffer);
                    
PrecacheDecal(buffertrue);
                    
AddFileToDownloadsTable(buffer_full);
                    
PrintToServer("Adding %s to downloads table"buffer_full);
                }
                else
                {
                    
PrintToServer("File does not exist! %s"buffer_full);
                }
            }
        }

    }

}

public 
player_death(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
headshot GetEventInt(event"headshot");
    new 
attacker GetEventInt(event"attacker");
    
    
decl String:overlaypath[PLATFORM_MAX_PATH];

    if (
headshot == 1)
    {
        
GetConVarString(sm_headshotoverlaypathsizeof(overlaypath));
        
ClientCommand(attacker"r_screenoverlay \"%s\""overlaypath);
    }

Where is my fault ?
m22b is offline
 



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 07:32.


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