Raised This Month: $32 Target: $400
 8% 

[CSGO] Show nickname on hud [not working]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Graffiti
AlliedModders Donor
Join Date: Aug 2013
Location: Russia
Old 02-08-2015 , 04:53   [CSGO] Show nickname on hud [not working]
Reply With Quote #1

I want to write a plugin Show nickname on hud for dead player and spectators.
Tell me why the plugin does not work. This is first plugin

Plugin while for SM 1.6.4
Attached Files
File Type: sp Get Plugin or Get Source (shownick.sp - 308 views - 1.5 KB)
__________________
Russian TTT CSGO


Last edited by Graffiti; 02-08-2015 at 04:55.
Graffiti is offline
lingzhidiyu
Senior Member
Join Date: Mar 2014
Old 02-12-2015 , 19:34   Re: [CSGO] Show nickname on hud [not working]
Reply With Quote #2

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

public Plugin:myinfo =
{
    
name "Show nick on HUD",
    
author "Graffiti",
    
description "Show nickname on hud",
    
version "1.0",
    
url "https://forums.alliedmods.net/"
};

public 
OnPluginStart()
{
    
CreateTimer(0.1Timer_TIMER_REPEAT);
    
//HookEvent("round_start", roundStart);
}

/*
public Action:roundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    CreateTimer(0.1, Timer, _, TIMER_REPEAT); << put in it in OnPluginStart. It wont get killed when round end.
}*/

stock TraceClientViewEntity(client)
{
    new 
Float:m_vecOrigin[3];
    new 
Float:m_angRotation[3];

    
GetClientEyePosition(clientm_vecOrigin);
    
GetClientEyeAngles(clientm_angRotation);

    new 
Handle:tr TR_TraceRayFilterEx(m_vecOriginm_angRotationMASK_VISIBLERayType_InfiniteTRDontHitSelfclient);
    new 
pEntity = -1;

    if (
TR_DidHit(tr))
    {
        
pEntity TR_GetEntityIndex(tr);
        
CloseHandle(tr);
        return 
pEntity;
    }

    if(
tr != INVALID_HANDLE)
    {
        
CloseHandle(tr);
    }
    
    return -
1;
}

public 
bool:TRDontHitSelf(entitymaskany:data)
{
    if (
entity == data)
    {
        return 
false;
    }
    return 
true;
}

public 
Action:Timer(Handle:timer)
{
    for(new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && !IsPlayerAlive(i))
        {
            new 
target TraceClientViewEntity(i);
            if(
target && target <= MaxClients && IsClientInGame(target) && IsPlayerAlive(target))
            {
                
decl String:szName[64];
                
GetClientName(targetszNamesizeof(szName));
                
PrintHintText(i"Player: %s"szName);
            }
        }
    }
    
//return Plugin_Stop; << Plugin_Stop wiil kill timer.

lingzhidiyu is offline
Reply


Thread Tools
Display Modes

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 23:58.


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