AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [CS:GO] How to get a player name from the spectator mode? (https://forums.alliedmods.net/showthread.php?t=317526)

Fastmancz 07-18-2019 03:40

[CS:GO] How to get a player name from the spectator mode?
 
1 Attachment(s)
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.

Fastmancz 07-18-2019 09:04

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

GetEntPropEnt(i, Prop_Send, "m_hObserverTarget");


All times are GMT -4. The time now is 23:27.

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