AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Wearable Item's Invisible (https://forums.alliedmods.net/showthread.php?t=184938)

desert420 05-10-2012 17:41

Wearable Item's Invisible
 
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!

TnTSCS 05-10-2012 18:08

Re: Wearable Item's Invisible
 
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

desert420 05-10-2012 18:16

Re: Wearable Item's Invisible
 
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!

TnTSCS 05-10-2012 20:02

Re: Wearable Item's Invisible
 
Colorize must be a custom function because it's not in the API

desert420 05-10-2012 20:04

Re: Wearable Item's Invisible
 
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]);
}
}
}


All times are GMT -4. The time now is 18:48.

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