I searched all google.
And there are a lot of methods to make a player invisible, i finally got one working well and not crashing the csgo game, but it doesn't work as it need to be :/
PHP Code:
//Define Invis stuff
#define INVIS {255,255,255,20}
#define NORMAL {255,255,255,255}
PHP Code:
public void Colorize(int client, int color[4])
{
int maxents = GetMaxEntities();
// Colorize player and weapons
int m_hMyWeapons = FindSendPropInfo("CBasePlayer", "m_hMyWeapons");
//int m_hMyWeapons = HasEntProp("CBasePlayer", "m_hMyWeapons");
for (int i = 0, weapon; i < 47; i += 4)
{
weapon = GetEntDataEnt2(client, m_hMyWeapons + i);
if (weapon > -1)
{
char strClassname[250];
GetEdictClassname(weapon, strClassname, sizeof(strClassname));
//PrintToChatAll("strClassname is: %s", strClassname);
SetEntityRenderMode(weapon, RENDER_TRANSCOLOR);
SetEntityRenderColor(weapon, color[0], color[1], color[2], color[3]);
}
}
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, color[0], color[1], color[2], color[3]);
// Colorize any wearable items
for (int i = MaxClients + 1; i <= maxents; i++)
{
if (!IsValidEntity(i))continue;
char netclass[32];
GetEntityNetClass(i, netclass, sizeof(netclass));
if (strcmp(netclass, "CTFWearableItem") == 0)
{
if (GetEntDataEnt2(i, g_wearableOffset) == client)
{
SetEntityRenderMode(i, RENDER_TRANSCOLOR);
SetEntityRenderColor(i, color[0], color[1], color[2], color[3]);
}
} else if (strcmp(netclass, "CTFWearableItemDemoShield") == 0)
{
if (GetEntDataEnt2(i, g_shieldOffset) == client)
{
SetEntityRenderMode(i, RENDER_TRANSCOLOR);
SetEntityRenderColor(i, color[0], color[1], color[2], color[3]);
}
}
}
return;
}
This way i make just the player invisible but not the "defuse kit, grenades, weapon, knife"
What is wrong with this to make the player invisible ? :/
for make invisible
PHP Code:
Colorize(client, INVIS);
and for make it visible im just setting
PHP Code:
Colorize(client, NORMAL);
halp crabs for u guys
__________________