CS:GO XRay

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Kami
Global Moderator
Posts: 263
Joined: Wed Aug 15, 2012 1:24 am
Location: Germany

CS:GO XRay

Postby Kami » Sun Apr 17, 2016 11:57 pm

Hey guys,

I just found out that you can see your teammates through walls in CS:GO if you are dead (I did not really play the game that much so I never noticed) and I thought that it should propably be possible to "abuse" this system and make it possible for living players to see other players through walls.

Does anyone have any insight on that or can lead me in the right direction?

I already tried messing with some properties, mainly "m_bCameraManXRay" but with no effect.

Thank you!

€: I found some properties that could help:

m_clrGlow

m_bShouldGlow
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: CS:GO XRay

Postby VinciT » Mon Apr 18, 2016 2:16 am

There are a few SourceMod plugins that allow admins to see through walls.

From what I understand, most of them basically just add another model(prop_physics_override) to the player with the same skin as the player model, and then use SetTransmit to make it visible only to the admins. They then set the properties 'm_bShouldGlow' and 'm_clrGlow' on that model.

A few months ago I messed around with glowing chickens, sadly this piece of code no longer works:

Syntax: Select all

#glowing_chicken.py
import random

from entities.entity import Entity
from players.entity import Player
from commands.client import ClientCommand


@ClientCommand('+lookatweapon')
def spawn_chicken(command, index):
player = Player(index)

chicken = Entity.create('chicken')
chicken.origin = player.view_coordinates
chicken.spawn()

chicken.set_property_int('m_bShouldGlow', 1)
chicken.set_property_int('m_clrGlow', rgb_to_long(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)))

def rgb_to_long(r, g, b):
long_color = b * 65536 + g * 256 + r
return long_color

I don't know what changed within CSGO to cause this not to work anymore. In any case, take a look at this SourceMod script to see how to achieve this.
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: CS:GO XRay

Postby VinciT » Mon Mar 06, 2017 7:46 pm

It's been a while, but I've been messing around with this stuff recently and found a way to do what you were looking for.

First things first, the reason the chickens didn't glow in my previous code snippet was because Valve added another property for the glow.
You need to set m_flGlowMaxDist in order for the glow to show. This is the maximum distance you can be from the glow and see it.

And here's the fully working wallhack plugin:

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 27 guests