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

Glow


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 12:41   Glow
Reply With Quote #1

Hi, i tried to do glow only for TE, and everything work fine, but if i respawn i see this



Who can help you solve this?

PHP Code:
#define EF_BONEMERGE                (1 << 0)
#define EF_NOSHADOW                 (1 << 4)
#define EF_NORECEIVESHADOW          (1 << 6)
#define EF_PARENT_ANIMATES          (1 << 9)

#define CPS_RENDER                  (1 << 0)
#define CPS_NOATTACHMENT            (1 << 1)
#define CPS_IGNOREDEATH             (1 << 2) 
 
void SetGlowing(int clientIndex)
{
    
char model[PLATFORM_MAX_PATH]; 
    
GetClientModel(clientIndexmodelsizeof(model)); 
    
int skin CreatePlayerModelProp(clientIndexmodel); 
    
SetEntProp(skinProp_Send"m_bShouldGlow"truetrue);
    
    
SetEntProp(skinProp_Send"m_nGlowStyle"0);
    
SetEntPropFloat(skinProp_Send"m_flGlowMaxDist"10000000.0);
    
    
// So now setup given glow colors for the skin
    
SetEntData(skinGetEntSendPropOffs(skin"m_clrGlow"), 192_true);    // Red
    
SetEntData(skinGetEntSendPropOffs(skin"m_clrGlow") + 1160_true); // Green
    
SetEntData(skinGetEntSendPropOffs(skin"m_clrGlow") + 296_true); // Blue
    
SetEntData(skinGetEntSendPropOffs(skin"m_clrGlow") + 364_true); // Alpha
}

 
int CreatePlayerModelProp(int clientchar[] sModel
{
    
RemoveSkin(client);
    
int Ent CreateEntityByName("prop_dynamic_override");
    
DispatchKeyValue(Ent"model"sModel);
    
DispatchKeyValue(Ent"disablereceiveshadows""1");
    
DispatchKeyValue(Ent"disableshadows""1");
    
DispatchKeyValue(Ent"solid""0");
    
DispatchKeyValue(Ent"spawnflags""256");
    
SetEntProp(EntProp_Send"m_CollisionGroup"11);
    
DispatchSpawn(Ent);
    
SetEntProp(EntProp_Send"m_fEffects"EF_BONEMERGE|EF_NOSHADOW|EF_NORECEIVESHADOW|EF_PARENT_ANIMATES);
    
SetVariantString("!activator");
    
AcceptEntityInput(Ent"SetParent"clientEnt0);
    
SetVariantString("primary");
    
AcceptEntityInput(Ent"SetParentAttachment"EntEnt0);
    
gPlayerModels[client] = EntIndexToEntRef(Ent);

    
SDKHook(EntSDKHook_SetTransmitOnShouldDisplay);
    return 
Ent;
}


void RemoveSkin(int client
{
    if(
IsValidEntity(gPlayerModels[client])) 
    {
        
AcceptEntityInput(gPlayerModels[client], "Kill");
    }
    
    
SetEntityRenderMode(clientRENDER_NORMAL);
    
gPlayerModels[client] = INVALID_ENT_REFERENCE;
}

public 
Action OnShouldDisplay(int Entint Client
{
    return (
GetClientTeam(Client) == CS_TEAM_CT)  ? Plugin_Handled Plugin_Continue;

__________________
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 12:49   Re: Glow
Reply With Quote #2

What's the problem?
I see too terrorists and cts.
__________________
xbatista is offline
Send a message via Skype™ to xbatista
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 12:55   Re: Glow
Reply With Quote #3

I added xray for zombie to my mod, so it work fine and when zombie infect human glow remove from them
But when i use antidot (Respawn) . I become a human and start see glow on the possitons, where it was created, but if i am human, i am on CT_TEAM so i must not see glow, this bug kust with respawn
__________________
gubka is offline
Send a message via ICQ to gubka
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 13:01   Re: Glow
Reply With Quote #4

When i play for zm
Spoiler


When i play for humans
Spoiler


When i respawn (become human from zombie (CHANGE TEAM))
Spoiler


I start see glow on the possition where it was created
__________________

Last edited by gubka; 03-17-2016 at 13:04.
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 13:12   Re: Glow
Reply With Quote #5

Try to detach or kill entity on player you've attached before respawning him and create new after that.
__________________

Last edited by xbatista; 03-17-2016 at 13:12.
xbatista is offline
Send a message via Skype™ to xbatista
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 13:15   Re: Glow
Reply With Quote #6

So you mean i need to delete all entities and create new for all humans?
But if i play for zombie i do not have glowing entity, just human have it
So when i respawn i start see entities on other humans, but all entities have this
PHP Code:
public Action OnShouldDisplay(int Entint Client)  

    return (
GetClientTeam(Client) == CS_TEAM_CT)  ? Plugin_Handled Plugin_Continue

__________________
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 13:22   Re: Glow
Reply With Quote #7

If player dies it could left his attached entity on that place, your glow prop_physics_override.

So try removing that attached entity before player dies or something like that.

And when you call SetGlowing(int clientIndex)?
__________________

Last edited by xbatista; 03-17-2016 at 13:22.
xbatista is offline
Send a message via Skype™ to xbatista
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 13:30   Re: Glow
Reply With Quote #8

I call it when mode started for all humans,
I removed all entities when player spawn or die or infect

I think problem with SDKHook_SetTransmit, because when you zombie you don't have this entity and you can see other entities on players
When you respawn you cahnge team on CT but still see this entities but not on the player , on the places where it was spawned, during mode started
__________________
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 13:39   Re: Glow
Reply With Quote #9

Try to teleport entity on player's position. I don't see that in your code.
__________________
xbatista is offline
Send a message via Skype™ to xbatista
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 13:48   Re: Glow
Reply With Quote #10

But entity allways attached to player when i do not respawn
__________________
gubka is offline
Send a message via ICQ to gubka
Reply



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 14:17.


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