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

Solved [CS:GO] How to get a player name from the spectator mode?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 07-18-2019 , 03:40   [CS:GO] How to get a player name from the spectator mode?
Reply With Quote #1

Hello,

I have a question. Is it possible to get player information from spectator mode (GUI CS:GO - 001.jpg)?

PHP Code:
#include <sourcemod>

char sPlayerName[60];

public 
Plugin myinfo =
{
    
name "Spectator Player Name",
    
author "Fastmancz",
    
description "",
    
version "1.0"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_spectname"spect);
}

public 
Action spect(clientargs)
{
    
PrintToChat(client"You are now spectating player: %N"sPlayerName); //You are now spectating player: Cecil

Thanks for answers.
Attached Images
File Type: jpg 001.jpg (92.7 KB, 277 views)
__________________


Main owner of the CMGPORTAL.CZ.
---------------------------------------
My plugins:
[CS:GO] Panorama - Timeleft
[CS:GO] JailBreak - Be quiet, please!

Last edited by Fastmancz; 07-18-2019 at 09:04.
Fastmancz is offline
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 07-18-2019 , 09:04   Re: [CS:GO] How to get a player name from the spectator mode?
Reply With Quote #2

Solved.

GetEntPropEnt(i, Prop_Send, "m_hObserverTarget");
__________________


Main owner of the CMGPORTAL.CZ.
---------------------------------------
My plugins:
[CS:GO] Panorama - Timeleft
[CS:GO] JailBreak - Be quiet, please!
Fastmancz 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 14:28.


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