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

X-ray for alive player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-23-2015 , 20:26   X-ray for alive player
Reply With Quote #1

Hello.
I just wanted to ask, is it possible to enable X-ray for specific players while they are alive?
I'm making custom mod with races and abilities and it would be awesome feature.

I tried hooking set_transmit but... I'm doing it wrong or this is impossible to achieve.

Code:
public OnClientPutInServer(client)
{
    SDKHook(client, SDKHook_SetTransmit, Hook_SetTransmit);
}

public Action:Hook_SetTransmit(entity, client)
{
    if (IsValidClient(entity))
    {
       
            Glow(entity, 0, 255 , 0 , 255);
            //SetEntProp(entity, Prop_Send, "m_iGlowType", 3);
            //SetEntProp(entity, Prop_Send, "m_nGlowRange", 0);

       
    }
    return Plugin_Continue;
}

stock Glow(entity, r, g, b, a)
{
	static offset;
	SetEntProp(entity, Prop_Send, "m_bShouldGlow", true, true);
	SetEntData(entity, offset, r, _, true);
	SetEntData(entity, offset + 1, g, _, true);
	SetEntData(entity, offset + 2, b, _, true);
	SetEntData(entity, offset + 3, a, _, true);
}
Thank You in advance for Your help guys.
VsX is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-24-2015 , 12:01   Re: X-ray for alive player
Reply With Quote #2

anyone?
VsX is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-24-2015 , 12:17   Re: X-ray for alive player
Reply With Quote #3

Not sure what you're doing with the glow stock function but you could try using these functions?

https://sm.alliedmods.net/new-api/en...ityRenderColor
https://sm.alliedmods.net/new-api/en...EntityRenderFx
https://sm.alliedmods.net/new-api/en...tityRenderMode
Drixevel is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-24-2015 , 12:34   Re: X-ray for alive player
Reply With Quote #4

I just want to make serverside x-ray wallhack/esp for alive players.
I don't think those functions can help me. I'm digging for solution since 2 days now
VsX is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-25-2015 , 05:19   Re: X-ray for alive player
Reply With Quote #5

*BUMP*

also, where Can I find more informations (full documentation) about Hook_SetTransmit and full list of flags I can modify?
VsX is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 11-25-2015 , 05:48   Re: X-ray for alive player
Reply With Quote #6

Quote:
Originally Posted by VsX View Post
*BUMP*
VsX plz...

You're hiding behind an account from 2007? Well, AlliedModders Rules still says:

Quote:
Do not "bump" your threads. Bumping is posting simply to make the thread higher in the forum sort order.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
boomix
Senior Member
Join Date: May 2015
Location: Latvia
Old 11-25-2015 , 07:42   Re: X-ray for alive player
Reply With Quote #7

You can't set the glow for the player, but you can set the glow for the players model. Try something like this:
PHP Code:
    #include <CustomPlayerSkins> 
    
char model[PLATFORM_MAX_PATH];
    
GetClientModel(clientmodelsizeof(model));
    
CPS_RemoveSkin(client);
    
CPS_SetSkin(clientmodelCPS_RENDER);
    
int skin CPS_GetSkin(client);
    
SetEntProp(skinProp_Send"m_bShouldGlow"truetrue); 
__________________

Last edited by boomix; 11-25-2015 at 07:43.
boomix is offline
grankee
Member
Join Date: Jun 2008
Old 01-30-2016 , 12:07   Re: X-ray for alive player
Reply With Quote #8

should be possible as a l4d infected can see players glow when they are alive, question is how
grankee is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 01-30-2016 , 18:35   Re: X-ray for alive player
Reply With Quote #9

Quote:
Originally Posted by boomix View Post
You can't set the glow for the player, but you can set the glow for the players model. Try something like this:
PHP Code:
    #include <CustomPlayerSkins> 
    
char model[PLATFORM_MAX_PATH];
    
GetClientModel(clientmodelsizeof(model));
    
CPS_RemoveSkin(client);
    
CPS_SetSkin(clientmodelCPS_RENDER);
    
int skin CPS_GetSkin(client);
    
SetEntProp(skinProp_Send"m_bShouldGlow"truetrue); 
correct
__________________
zipcore is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-30-2016 , 19:23   Re: X-ray for alive player
Reply With Quote #10

Quote:
Originally Posted by boomix View Post
You can't set the glow for the player, but you can set the glow for the players model. Try something like this:
PHP Code:
    #include <CustomPlayerSkins> 
    
char model[PLATFORM_MAX_PATH];
    
GetClientModel(clientmodelsizeof(model));
    
CPS_RemoveSkin(client);
    
CPS_SetSkin(clientmodelCPS_RENDER);
    
int skin CPS_GetSkin(client);
    
SetEntProp(skinProp_Send"m_bShouldGlow"truetrue); 
You don't need to do CPS_RemoveSkin on a client, the SetSkin will automatically remove it.
Also CPS_SetSkin will return the skin index, so you dont need CPS_GetSkin ;)

quick diff:
Code:
char model[PLATFORM_MAX_PATH]; 
GetClientModel(client, model, sizeof(model)); 
int skin = CPS_SetSkin(client, model, CPS_RENDER); 
SetEntProp(skin, Prop_Send, "m_bShouldGlow", true, true);
Also here is the link to the plugin: https://forums.alliedmods.net/showthread.php?p=2140384

Last edited by Mitchell; 01-30-2016 at 19:24.
Mitchell is offline
Reply



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 08:08.


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