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

Wearable Item's Invisible


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
desert420
Junior Member
Join Date: May 2009
Old 05-10-2012 , 17:41   Wearable Item's Invisible
Reply With Quote #1

Does anyone know the code to make wearable items invisible?

Currently when my plugin makes someone invisible people can still see that persons hat and other wearable items floating around.

Thanks in advance!
desert420 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 05-10-2012 , 18:08   Re: Wearable Item's Invisible
Reply With Quote #2

what method are you using to make the players invisible? I've never done it, but I would think SetEntityRenderMode would work... just cycle through all entities and if the parent entity is the client, set it to RENDER_NONE?

Again, not sure if the above works, but if it does, it's only 1 of probably 3 different ways.

There's also SDKHook_SetTransmit
__________________
View my Plugins | Donate

Last edited by TnTSCS; 05-10-2012 at 18:11.
TnTSCS is offline
desert420
Junior Member
Join Date: May 2009
Old 05-10-2012 , 18:16   Re: Wearable Item's Invisible
Reply With Quote #3

I'm using Colorize(client, INVIS) and Colorize(client, NORMAL).

My laptop crashed and I for some reason didn't backup my source so i'm having to redo everything from an old source I had. Keep in mind this was 2 years ago and really forgot how to code.

Any help on this would be great!

Last edited by desert420; 05-10-2012 at 18:44.
desert420 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 05-10-2012 , 20:02   Re: Wearable Item's Invisible
Reply With Quote #4

Colorize must be a custom function because it's not in the API
__________________
View my Plugins | Donate
TnTSCS is offline
desert420
Junior Member
Join Date: May 2009
Old 05-10-2012 , 20:04   Re: Wearable Item's Invisible
Reply With Quote #5

Here is my code that isnt working for wearable items.


// Colorize any wearable items
for (new i=MaxClients+1; i <= maxents; i++)
{
if(!IsValidEntity(i)) continue;

decl String:netclass[32];
GetEntityNetClass(i, netclass, sizeof(netclass));

if(strcmp(netclass, "tf_wearable") == 0)
{
if(GetEntDataEnt2(i, g_wearableOffset) == client)
{
SetEntityRenderMode(i, RENDER_TRANSCOLOR);
SetEntityRenderColor(i, color[0], color[1], color[2], color[3]);
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, color[0], color[1], color[2], color[3]);
}
}
if(strcmp(netclass, "tf_wearable_demoshield") == 0)
{
if(GetEntDataEnt2(i, g_shieldOffset) == client)
{
SetEntityRenderMode(i, RENDER_TRANSCOLOR);
SetEntityRenderColor(i, color[0], color[1], color[2], color[3]);
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, color[0], color[1], color[2], color[3]);
}
}
}

Last edited by desert420; 05-11-2012 at 19:24.
desert420 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 13:57.


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