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

SetParent problem.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-08-2012 , 17:53   SetParent problem.
Reply With Quote #1

PHP Code:
new Float:Pos[3];
GetEntPropVectorclientProp_Send"m_vecOrigin"Pos );
Pos[2] += 100.0;
    
new 
entity CreateEntityByName("prop_dynamic_override");
if( 
entity != -)
{
    
PrintToChatAll("succsess33333");
    
SetEntityModelentity"models/Shells/shell_9mm.mdl" );
    
DispatchSpawnentity);
    
    
SetEntPropFloatentityProp_Send"m_flModelScale"3.0 );
    
    
SetVariantString("!activator");
    
SetVariantString"eyes" );
    
AcceptEntityInputentity"SetParent"client);
    
AcceptEntityInputentity"SetParentAttachment" );
    
AcceptEntityInputentity"DisableCollision");
    
TeleportEntityentityPosNULL_VECTORNULL_VECTOR);

The problem is, the gun shell won't follow me where i go... any help?

Last edited by GsiX; 10-08-2012 at 18:12.
GsiX is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-08-2012 , 18:05   Re: SetParent problem.
Reply With Quote #2

Quote:
Originally Posted by GsiX View Post
PHP Code:
new Float:Pos[3];
GetEntPropVectorclientProp_Send"m_vecOrigin"Pos );
BeamPos[2] += 100.0;
    
new 
entity CreateEntityByName("prop_dynamic_override");
if( 
entity != -)
{
    
PrintToChatAll("succsess33333");
    
SetEntityModelentity"models/Shells/shell_9mm.mdl" );
    
DispatchSpawnentity);
    
    
SetEntPropFloatentityProp_Send"m_flModelScale"3.0 );
    
    
SetVariantString("!activator");
    
SetVariantString"eyes" );
    
AcceptEntityInputentity"SetParent"client);
    
AcceptEntityInputentity"SetParentAttachment" );
    
AcceptEntityInputentity"DisableCollision");
    
TeleportEntityentityPosNULL_VECTORNULL_VECTOR);

The problem is, the gun shell won't follow me where i go... any help?
Going out on a limb here:
Code:
    SetVariantString("!activator");
    AcceptEntityInput( entity, "SetParent", client);
    SetVariantString( "eyes" );
    AcceptEntityInput( entity, "SetParentAttachment" );
Mitchell is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-08-2012 , 18:08   Re: SetParent problem.
Reply With Quote #3

PHP Code:
SetVariantString("!activator");
AcceptEntityInputentity"SetParent"client);
SetVariantString"eyes" );
AcceptEntityInputentity"SetParentAttachment" ); 
ERROR: Tried to SetParentAttachment for entity prop_dynamic (prop_dynamic), but it has no attachment named eyes.


Last edited by GsiX; 10-08-2012 at 18:10.
GsiX is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-09-2012 , 09:04   Re: SetParent problem.
Reply With Quote #4

Quote:
Originally Posted by GsiX View Post
PHP Code:
SetVariantString("!activator");
AcceptEntityInputentity"SetParent"client);
SetVariantString"eyes" );
AcceptEntityInputentity"SetParentAttachment" ); 
ERROR: Tried to SetParentAttachment for entity prop_dynamic (prop_dynamic), but it has no attachment named eyes.

use an attachment that is actually on the model, usually it's forward, but you never stated your game.
Mitchell is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-09-2012 , 10:54   Re: SetParent problem.
Reply With Quote #5

Sorry, its CS:S.. i need to wait few more hours before i can borrow the laptop again to continue my CS:S project. Right now still working on the info. Relly appreciate if anyone can help.
GsiX is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-09-2012 , 11:09   Re: SetParent problem.
Reply With Quote #6

what @Mitchell already mention, it depend model "attachments".
Can check from source sdk model viewer
*edit
If I remember right, attachment can move (or dublicated) when have weapon... something like that.


Spoiler

Last edited by Bacardi; 10-09-2012 at 11:14.
Bacardi is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-09-2012 , 11:19   Re: SetParent problem.
Reply With Quote #7

Can't wait my friend back from work...

Imma try that as soon as my CS:S go home...

Thanks in advance..
GsiX is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 10-09-2012 , 13:49   Re: SetParent problem.
Reply With Quote #8

not all css player models have the forward attachment if i remember correctly.
blodia is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 10-09-2012 , 13:53   Re: SetParent problem.
Reply With Quote #9

Correcto blodia!
__________________
thetwistedpanda is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 10-09-2012 , 14:37   Re: SetParent problem.
Reply With Quote #10

PHP Code:
#include <sdktools>


public OnPluginStart()
{
    
RegConsoleCmd("sm_test"test);
}

public 
OnConfigsExecuted()
{
    
PrecacheModel("models/shells/shell_9mm.mdl");
}

public 
Action:test(clientargs)
{
    new 
ent CreateEntityByName("prop_dynamic");

    if(
ent == -1)
    {
        return 
Plugin_Handled;
    }

    
DispatchKeyValue(ent"model""models/shells/shell_9mm.mdl");
    
DispatchKeyValue(ent"skin""0");
    
DispatchKeyValue(ent"spawnflags""0");
    
DispatchSpawn(ent);

    new 
Float:origin[3];
    
GetClientAbsOrigin(clientorigin);
    
origin[2] += 10.0;
    
TeleportEntity(entoriginNULL_VECTORNULL_VECTOR);
    
SetEntPropFloatentProp_Send"m_flModelScale"3.0 );

    
SetVariantString("!activator");
    
AcceptEntityInput(ent"SetParent"client);

    
SetVariantString("OnUser1 !self,SetParentAttachmentMaintainOffset,forward,0.1,-1");
    
AcceptEntityInput(ent"AddOutput");
    
AcceptEntityInput(ent"FireUser1");
    
PrintToChat(client"should be above you...")
    return 
Plugin_Handled;

Work like a charm.. Now my problem with the BeamSpirit solved. Kill the little transparent bullet attached to the player will kill the BeamSpirit.

I m working on plugin call human versus predator. With your help so far so good. If i plan to release it (didn't consider it yet), i will give credit to you.
The only remaining problem is the head shoot to the predator, but that is another chapter.

Million thanks..

Last edited by GsiX; 10-09-2012 at 14:43.
GsiX 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 13:49.


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