AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Attaching entity to player (https://forums.alliedmods.net/showthread.php?t=11475)

LynX 03-20-2005 17:16

Attaching entity to player
 
I would need a help around here. You see - I'm trying to make that player has an entity which is stick to him and follows him all the time untill I delete it with an other function. I already looked in Ludwig Vans Kamikazi plugin but that didn't help out.
So, I'm requesting a code snippet which would show me how to do it.
Thanks!

P.S.

If I set that entitys model - would it replace players model? If it will - that's awsome :)

Freecode 03-20-2005 17:43

look in HL SDK for player attachments it tells u how to do it in there

Jinto 03-20-2005 22:45

Well. Set the movetype of the entity to MOVETYPE_FOLLOW. and set aiment to the entity you want it to follow.

And if your trying to replace the player model in esf this method does work. Just is very ugly in adv melee. I have yet to find a legit way of changing the player models. So I use this method.

You also gotta hide the player by making them render invisible. ( DO NOT USE set_user_visibility ).

LynX 03-21-2005 00:21

Yep - trying to change model...
I know that refreshing bug in advanced melee. But say - when I set player invisible - doesn't kRenderFXNone grows big when turbo on?

Can you please show me the code snippet coz I didn't understood it well :D

Jinto 03-21-2005 06:04

Yes.
Oh and another quick note. the player becomes visible again right when he starts swooping. so you will have to keep him invisible.

And turbo is a model not a render effect.

Code:

new player_avatar = create_entity( "env_model" );
       
entity_set_int( player_avatar, EV_INT_movetype, MOVETYPE_FOLLOW );
entity_set_edict( player_avatar, EV_ENT_aiment, id );
       
entity_set_model( player_avatar, "<playermodel>" );

It will automatically assume the players animations.

LynX 03-21-2005 07:27

Thanks man!!!!! :) :) :) :) :) :) :) :)

I sent you PM. Please answer on it...

Your the best!


All times are GMT -4. The time now is 13:58.

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