Raised This Month: $ Target: $400
 0% 

Hat is invisible to others players when I use "kRenderTransAlpha"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-23-2016 , 16:17   Hat is invisible to others players when I use "kRenderTransAlpha"
Reply With Quote #1

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:



(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

Last edited by OciXCrom; 01-23-2016 at 16:18.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-02-2016 , 06:29   Re: Hat is invisible to others players when I use "kRenderTransAlpha"
Reply With Quote #2

Bump.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-13-2016 , 10:30   Re: Hat is invisible to others players when I use "kRenderTransAlpha"
Reply With Quote #3

Anyone? I'm still searching for a solution.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-13-2016 , 13:27   Re: Hat is invisible to others players when I use "kRenderTransAlpha"
Reply With Quote #4

want add transparency for yourself ??

PHP Code:
set_user_renderingidkRenderFxNone000kRenderTransAlpha127
Or

PHP Code:
set_esentES_RenderAmt127

Last edited by EFFx; 03-13-2016 at 13:28.
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-13-2016 , 14:56   Re: Hat is invisible to others players when I use "kRenderTransAlpha"
Reply With Quote #5

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.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-13-2016 , 15:40   Re: Hat is invisible to others players when I use "kRenderTransAlpha"
Reply With Quote #6

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)
 } 

Last edited by EFFx; 03-13-2016 at 15:40.
EFFx 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 09:25.


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