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

[CSGO] m_lifeState is deleting skin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 12-12-2019 , 11:46   [CSGO] m_lifeState is deleting skin
Reply With Quote #1

Hi,
I am working at custom re-die plugin. I am pushing
SetEntProp(client, Prop_Send, "m_lifeState", 1);
And its ok, after respawn i set lifeState to 1, player is "dead", but can move etc.
When lifeState 1 is trigerred, its disabling rendering.
I am checkin offsets, so.. (changing them to exact as living value)

*** m_nRenderFX 0, m_nRenderMode 1, m_clrRender -1, m_nSkin 0, ent effects 8***
*DEAD* SUPER TIMOR : !ghost
***m_nRenderFX 0, m_nRenderMode 1, m_clrRender -1, m_nSkin 0, ent effects 8***
Model is still not drawable. Any ideas?

// of course goal is to make re-died character visible by other re-died players

re-die - "ghost mode", to play while alive

Last edited by supertimor; 12-12-2019 at 11:51.
supertimor is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 12-12-2019 , 13:58   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #2

Okay.. next step.
I am using solution from Mitch's plugin, also Zeph's store is included.. so mixed

public int CreatePlayerModelProp(int client, char[] sModel) {
float m_flClientOrigin[3], m_flClientAngles[3];
float m_flPosition[3] = {0.0, 0.0, -20.0};
float m_flAngles[3] = {0.0, 0.0, 0.0};
GetClientAbsOrigin(client, m_flClientOrigin);
GetClientAbsAngles(client, m_flClientAngles);
float m_fForward[3];
float m_fRight[3];
float m_fUp[3];
GetAngleVectors(m_flClientAngles, m_fForward, m_fRight, m_fUp);
m_flClientOrigin[0] += m_fRight[0]*m_flPosition[0]+m_fForward[0]*m_flPosition[1]+m_fUp[0]*m_flPosition[2];
m_flClientOrigin[1] += m_fRight[1]*m_flPosition[0]+m_fForward[1]*m_flPosition[1]+m_fUp[1]*m_flPosition[2];
m_flClientOrigin[2] += m_fRight[2]*m_flPosition[0]+m_fForward[2]*m_flPosition[1]+m_fUp[2]*m_flPosition[2];
m_flAngles[1] += m_flClientAngles[1];

int skin = CreateEntityByName("prop_dynamic_override");
DispatchKeyValue(skin, "model", sModel);
DispatchKeyValue(skin, "disablereceiveshadows", "1");
DispatchKeyValue(skin, "disableshadows", "1");
DispatchKeyValue(skin, "solid", "0");
DispatchKeyValue(skin, "spawnflags", "256");
SetEntProp(skin, Prop_Send, "m_CollisionGroup", 11);
DispatchSpawn(skin);
AcceptEntityInput(skin, "TurnOn", skin, skin, 0);
SetEntProp(skin, Prop_Send, "m_fEffects", EF_BONEMERGE|EF_NOSHADOW|EF_NORECEIVESHADOW|E F_PARENT_ANIMATES);
TeleportEntity(skin, m_flClientOrigin, m_flAngles, NULL_VECTOR);
SetVariantString("!activator");
// AcceptEntityInput(skin, "SetParent", client, skin, 0);
// AcceptEntityInput(skin, "SetParentAttachmentMaintainOffset", skin, skin, 0);
CreateTimer(0.5, Parent, client);
return skin;
}
public Action Parent(Handle timer, any client) {
if(IsValidEntity(ghostModel[client]))
{
AcceptEntityInput(ghostModel[client], "SetParent", client, ghostModel[client], 0);
AcceptEntityInput(ghostModel[client], "SetParentAttachmentMaintainOffset", ghostModel[client], ghostModel[client], 0);
}
}

There's funny thing. If I parent entity to me, its changing it's angles and position, even if I teleport it before.
supertimor is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-14-2019 , 05:21   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #3

Huh, what exactly are you trying to do? How's the re-die plugin supposed to work?
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 12-14-2019 at 05:22.
Shadowysn is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 12-14-2019 , 11:00   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #4

https://forums.alliedmods.net/showthread.php?t=308306

This is plugin i am working on, and currently added a lot of features. I am working on next feature, where players can see each other when dead, ghosted.
SetTransmit has nothing to do with this, because if player m_LifeState is 1/2, there's no chance to switch player model or anything. So i need to make an entity, parent it to a player and set entity's model. Its working, but when I try to parent this entity, its switching position to top/right of player's head, looking to the right. Always.
I tried to TeleportEntity after spawning it, before parenting. No results..
supertimor is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-15-2019 , 02:04   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #5

Quote:
Originally Posted by supertimor View Post
https://forums.alliedmods.net/showthread.php?t=308306

This is plugin i am working on, and currently added a lot of features. I am working on next feature, where players can see each other when dead, ghosted.
SetTransmit has nothing to do with this, because if player m_LifeState is 1/2, there's no chance to switch player model or anything. So i need to make an entity, parent it to a player and set entity's model. Its working, but when I try to parent this entity, its switching position to top/right of player's head, looking to the right. Always.
I tried to TeleportEntity after spawning it, before parenting. No results..
You can try this:
PHP Code:
public int CreatePlayerModelProp(int clientchar[] sModel) {
    
float m_flClientOrigin[3], m_flClientAngles[3];
    
float m_flPosition[3] = {0.00.0, -20.0};
    
float m_flAngles[3] = {0.00.00.0};
    
GetClientAbsOrigin(clientm_flClientOrigin);
    
GetClientAbsAngles(clientm_flClientAngles);
    
float m_fForward[3];
    
float m_fRight[3];
    
float m_fUp[3];
    
GetAngleVectors(m_flClientAnglesm_fForwardm_fRightm_fUp);
    
m_flClientOrigin[0] += m_fRight[0]*m_flPosition[0]+m_fForward[0]*m_flPosition[1]+m_fUp[0]*m_flPosition[2];
    
m_flClientOrigin[1] += m_fRight[1]*m_flPosition[0]+m_fForward[1]*m_flPosition[1]+m_fUp[1]*m_flPosition[2];
    
m_flClientOrigin[2] += m_fRight[2]*m_flPosition[0]+m_fForward[2]*m_flPosition[1]+m_fUp[2]*m_flPosition[2];
    
m_flAngles[1] += m_flClientAngles[1];
    
    
int skin CreateEntityByName("prop_dynamic_override");
    
DispatchKeyValue(skin"model"sModel);
    
DispatchKeyValue(skin"disablereceiveshadows""1");
    
DispatchKeyValue(skin"disableshadows""1");
    
DispatchKeyValue(skin"solid""0");
    
DispatchKeyValue(skin"spawnflags""256");
    
SetEntProp(skinProp_Send"m_CollisionGroup"11);
    
DispatchSpawn(skin);
    
AcceptEntityInput(skin"TurnOn"skinskin0);
    
SetEntProp(skinProp_Send"m_fEffects"EF_BONEMERGE|EF_NOSHADOW|EF_NORECEIVESHADOW|EF_PARENT_ANIMATES);
    
TeleportEntity(skinm_flClientOriginm_flAnglesNULL_VECTOR);
    
SetEntPropEnt(skinProp_Send"moveparent"client);
    return 
skin;

__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 12-15-2019 at 07:44.
Shadowysn is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 12-15-2019 , 06:33   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #6

https://imgur.com/a/NnwWqOW
Unfortunately, the same effect. I am standing on the ground of course, so model is attached to top-right point of my head, facing my right.
supertimor is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-15-2019 , 07:43   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #7

Quote:
Originally Posted by supertimor View Post
https://imgur.com/a/NnwWqOW
Unfortunately, the same effect. I am standing on the ground of course, so model is attached to top-right point of my head, facing my right.
Try replacing:
PHP Code:
SetEntProp(skinProp_Send"m_fEffects"EF_BONEMERGE|EF_NOSHADOW|EF_NORECEIVESHADOW|EF_PARENT_ANIMATES); 
with:
PHP Code:
SetEntProp(skinProp_Send"m_fEffects"EF_NOSHADOW|EF_NORECEIVESHADOW); 
I suspect it's because of the prop being bonemerged to the player, and since the player is dead, wonky things would happen.
The model won't be able to follow the player's animations though.
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 12-15-2019 at 07:44.
Shadowysn is offline
supertimor
AlliedModders Donor
Join Date: Sep 2017
Old 12-15-2019 , 08:36   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #8

If I remove EF_BONEMERGE, then model won't show for me :/
supertimor is offline
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 12-15-2019 , 10:02   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #9

Quote:
Originally Posted by supertimor View Post
If I remove EF_BONEMERGE, then model won't show for me :/
You can probably take a look at the [L4D2] Incapped Crawling with Animation plugin, it uses a similar system of a fake model for the player, but without bonemerging.
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4

Last edited by Shadowysn; 12-15-2019 at 10:04.
Shadowysn is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 12-15-2019 , 14:38   Re: [CSGO] m_lifeState is deleting skin
Reply With Quote #10

puuuh.....try to set the parentbone correctly ex:

PHP Code:
SetVariantString("!activator");
AcceptEntityInput(skin"SetParent"Clientskin);
// "facemask" CSGO should match what you want......
SetVariantString("facemask"); 
AcceptEntityInput(skin"SetParentAttachment"skinskin0); 
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
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 18:49.


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