AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hat is invisible to others players when I use "kRenderTransAlpha" (https://forums.alliedmods.net/showthread.php?t=278046)

OciXCrom 01-23-2016 16:17

Hat is invisible to others players when I use "kRenderTransAlpha"
 
So, I made a completely new plugin for hats and I added an option to change between two hat glow types: normal and transparent. When the hat glow is set to "normal", there are no problems with it, but when it's set to "transparent", the hat is completely invisible to other players. Only the player who uses it can see it (using /cam plugin). Here's what I'm talking about:

http://i.imgur.com/4IDyFwS.jpg

(Both players on the picture have the same hat and as you can see, only I can see my hat, and only the other player can see his hat (well you can't actually see that).)

This is how I add the hat and set its transparency:

PHP Code:

#define HAT_TRANSPARENCY 10.0

g_entHat[id] = create_entity("info_target")
set_pev(g_entHat[id], pev_movetypeMOVETYPE_FOLLOW)
set_pev(g_entHat[id], pev_aimentid)
set_pev(g_entHat[id], pev_renderfxkRenderFxGlowShell)
set_pev(g_entHat[id], pev_renderamtHAT_TRANSPARENCY)
updateType(id)

engfunc(EngFunc_SetModelg_entHat[id], g_szHats[g_iHat[id] - 2])
entity_set_int(g_entHat[id], EV_INT_bodystr_to_num(g_szHats[g_iHat[id] - 1]))
fm_set_entity_visibility(g_entHat[id], 1)
updateColor(id)

public 
updateColor(id)
{
    new 
Float:iColor[3]
    
iColor[0] = float(g_iColor[id][RED])
    
iColor[1] = float(g_iColor[id][GREEN])
    
iColor[2] = float(g_iColor[id][BLUE])
    
set_pev(g_entHat[id], pev_rendercoloriColor)
}

public 
updateType(id)
    
set_pev(g_entHat[id], pev_rendermodeg_iColor[id][MODE] ? kRenderTransAlpha kRenderNormal// the variable is "1" when the hat should be transparent

stock fm_set_entity_visibility(indexvisible 1set_pev(indexpev_effectsvisible == pev(indexpev_effects) & ~EF_NODRAW pev(indexpev_effects) | EF_NODRAW


OciXCrom 02-02-2016 06:29

Re: Hat is invisible to others players when I use "kRenderTransAlpha"
 
Bump.

OciXCrom 03-13-2016 10:30

Re: Hat is invisible to others players when I use "kRenderTransAlpha"
 
Anyone? I'm still searching for a solution.

EFFx 03-13-2016 13:27

Re: Hat is invisible to others players when I use "kRenderTransAlpha"
 
want add transparency for yourself ??

PHP Code:

set_user_renderingidkRenderFxNone000kRenderTransAlpha127

Or

PHP Code:

set_esentES_RenderAmt127


OciXCrom 03-13-2016 14:56

Re: Hat is invisible to others players when I use "kRenderTransAlpha"
 
I'm not trying to make my self transparent, but my hat. You probably didn't read my post carefully. When I make my hat transparent - I'm the only one who sees is as it should be, and everyone else can't see the hat at all. I tried using set_es and it crashed the server.

EFFx 03-13-2016 15:40

Re: Hat is invisible to others players when I use "kRenderTransAlpha"
 
Test:

PHP Code:

#define MAX_PLAYERS 32

 
new iPlayers[MAX_PLAYERS], iNumid
 get_players
(iPlayersiNum"ae")
 for(new 
ii<iNumi++)
 {
  
id iPlayers[i]
  
set_user_renderingidkRenderFxNone000kRenderTransAlpha127)
 } 



All times are GMT -4. The time now is 09:25.

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