--
[ Picked text/plain from multipart/alternative ]
I don't want to make a whole new topic for this, so this is my problem that
im facing

I want it, so that when you use this object, it toggles a panel.

To call an engine->ClientCommand(); you need to have an edict_t;
I coded my own function under CSDKPlayer called GetPlayerEdict() and it
returns s_PlayerEdict;

So in my code of my barrel prop I have

void CItem_ItemBarrel::Use( CBaseEntity *pActivator, CBaseEntity *pCaller,
USE_TYPE useType, float value )
{
    if (!pActivator)
        return;

    if ( !pActivator->IsPlayer() )
        return;

    CSDKPlayer *pPlayer = dynamic_cast<CSDKPlayer *>(pActivator);

    engine->ClientCommand(pPlayer->GetPlayerEdict(),"ToggleBarrelPanel");


But it seems to error when it creates the player.

Any ideas?

THanks

On 4/18/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
>
> Nevermind I figured it out, Thanks again, You guys are awesome :D
>
> -Kramer
>
> On 4/18/06, Michael Kramer < [EMAIL PROTECTED]> wrote:
> >
> > Alright, I guess I replied before i noticed the rest of you replied.
> > Anyway, howdo I use this FCAP_IMPULE_USE or whatever?
> >
> > Well, what im asking is where and howdo I implement it?
> >
> > Thanks for your help again. It is really appreciated.
> >
> >
> > On 4/18/06, Michael Kramer < [EMAIL PROTECTED]> wrote:
> > >
> > > Thank you so much, it works like a charm :D
> > >
> > >
> > > On 4/18/06, Aaron Schiff <[EMAIL PROTECTED]> wrote:
> > > >
> > > > --
> > > > [ Picked text/plain from multipart/alternative ]
> > > > ObjectCaps( void ) { return (BaseClass::ObjectCaps() &
> > > > FCAP_IMPULSE_USE); }
> > > >
> > > > your use should be called then..
> > > >
> > > > use DEFINE_ENTITYFUNC( OnTouch ) or just override Touch( CBaseEntity
> > > > *pOther
> > > > )
> > > >
> > > >
> > > > On 4/18/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > --
> > > > > [ Picked text/plain from multipart/alternative ]
> > > > > Sorry, I guess I should be more specific.
> > > > >
> > > > > Basically I have a CItem_Item_Barrel : public CPhysicsProp{}, I
> > > > basically
> > > > > want to have it, so when a player
> > > > > goes next to the barrel prop. And uses the IN_USE Key, that the
> > > > barrel
> > > > > will
> > > > > do something.
> > > > >
> > > > > I have a function declared as void Use( CBaseEntity *pActivator,
> > > > > CBaseEntity
> > > > > *pCaller, USE_TYPE useType, float value );
> > > > > And it has a properly implemented body.
> > > > >
> > > > > In my void CItem_ItemBarrel::Spawn( void ) I call a SetUse( Use );
> > > > > and in my BEGIN_DATADESC( CItem_ItemBarrel )
> > > > >
> > > > > I have a DEFINE_USEFUNC( Use ),
> > > > >
> > > > > But I don't know, howto make it so that when the player presses
> > > > the IN_USE
> > > > > key it will activate my
> > > > > Use Function.
> > > > >
> > > > > OR, what I wanted to try to implement a OnTouch method but in
> > > > > BEGIN_DATADESC( CItem_ItemBarrel )
> > > > >
> > > > > There is no DEFINE_TOUCHFUNC( OnTouch ), So I was wondering
> > > > either, how to
> > > > > get my
> > > > >
> > > > > Use() function to work or howto define a touch function.
> > > > >
> > > > > I am not that familiar with this part of coding, I stayed mostly
> > > > with
> > > > > weapons in my last mod.
> > > > >
> > > > > But is there a way, that I could have something like class
> > > > > CItem_ItemBarrel
> > > > > : public CPhysicsProp : public CItem{}
> > > > >
> > > > > In which I could have my barrel be a PhysicsProp and an Item.
> > > > >
> > > > > Thanks for any help. And sorry for being so vague before, I wasn't
> > > > with
> > > > > the
> > > > > code when I sent it.
> > > > >
> > > > > -Kramer
> > > > >
> > > > >
> > > > > On 4/18/06, Physical Mayhem Bug < [EMAIL PROTECTED]>
> > > > wrote:
> > > > > >
> > > > > > SetTouch
> > > > > >
> > > > > > At 2006/04/18 12:24 PM, Michael Kramer wrote:
> > > > > > >--
> > > > > > >[ Picked text/plain from multipart/alternative ]
> > > > > > >In the SDK, howdo I define a OnTouch function?
> > > > > > >
> > > > > > >Or actually, it would be better if I could define a On_Use
> > > > Function.
> > > > > > >
> > > > > > >I can't seem to figure it out. The only one I could see being
> > > > used was
> > > > > > >Think, which
> > > > > > >doesn't help me.
> > > > > > >
> > > > > > >
> > > > > > >Thanks for any help
> > > > > > >
> > > > > > >-Kramer
> > > > > > >--
> > > > > > >
> > > > > > >_______________________________________________
> > > > > > >To unsubscribe, edit your list preferences, or view the list
> > > > archives,
> > > > > > please visit:
> > > > > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > > > > >
> > > > > > _______________________________________________
> > > > > > To unsubscribe, edit your list preferences, or view the list
> > > > archives,
> > > > > > please visit:
> > > > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > > > > >
> > > > > >
> > > > > --
> > > > >
> > > > > _______________________________________________
> > > > > To unsubscribe, edit your list preferences, or view the list
> > > > archives,
> > > > > please visit:
> > > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > ts2do
> > > > --
> > > >
> > > > _______________________________________________
> > > > To unsubscribe, edit your list preferences, or view the list
> > > > archives, please visit:
> > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
> > > >
> > > >
> > >
> >
>
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to