--
[ Picked text/plain from multipart/alternative ]
Ah yes, I have been wrestling with this issue for "put a graphic on the
screen denoting a destination from a server side entity" I have decided to
take the easy route that you could possibly take as well.
In hl2mp_gamerules.h
Under the class definition you can add this,
CNetworkVar(bool, m_bCurrentSpellType);
And to hook it up between the client and server you can add to this
BEGIN_NETWORK_TABLE_NOBASE( CHL2MPRules, DT_HL2MPRules )
#ifdef CLIENT_DLL
RecvPropBool( RECVINFO( m_bCurrentSpellType) ),
#else
SendPropBool( SENDINFO( m_bCurrentSpellType) ),
#endif
END_NETWORK_TABLE()
And just include hl2mp_gamerules where you need to and do this to work the
variables between client and server.
CHL2MPRules *pRules = HL2MPRules();
pRules->m_bCurrentSpellType = false;
This is probably the wrong way to do this :P Heck, it might horrify someone
from Valve so much they write out a best use guide again :P
On 4/10/06, Michael Kramer <[EMAIL PROTECTED]> wrote:
>
> --
> [ Picked text/plain from multipart/alternative ]
> In my weapon, I have a value, called m_bCurrentSpellType which gets a
> value
> from a Client side only function (it is from a panel)
>
> #ifdef CLIENT_DLL
> m_bCurrentSpellType = spell->spellId;
> #endif
>
> The problem I have, is when I do, something such as
>
> if(m_bCurrentSpellType == 1 ){
> DoSomething();
> }
> if(m_bCurrentSpellType == 2 ){
> DoSomethingElse();
> }
>
> When I run it in game, I then change the value, from 1 to 2, but then when
> I
> fire
>
> it Does both, because on the client the value is 2, while on the server
> the
> value is 1.
>
> If the value is 1, it is supposed to set fires, at the tr.endpos which it
> does, but as soon
> as the value is changed, to value 2, which is supposed to teleport you,
> because the server
> keeps track of the pPlayer->GetAbsOrigin();, when I change it, it kind of
> flashes, but
> you don't move, and it then lights a fire, which is how I came to this
> conclusion.
>
> I have also tried something like
>
> IMPLEMENT_NETWORKCLASS_ALIASED( WeaponMagic, DT_WeaponMagic )
>
> BEGIN_NETWORK_TABLE( CWeaponMagic, DT_WeaponMagic )
> #ifdef CLIENT_DLL
> RecvPropInt( RECVINFO( m_bCurrentSpellType ) ),
> #else
> SendPropInt( SENDINFO( m_bCurrentSpellType ) ),
> #endif
> END_NETWORK_TABLE()
>
> BEGIN_PREDICTION_DATA( CWeaponMagic )
> DEFINE_PRED_FIELD( m_bCurrentSpellType, FIELD_INTEGER,
> FTYPEDESC_INSENDTABLE
> ),
> END_PREDICTION_DATA()
>
> But it still isn't working, and I thought that the RecvPropInt and
> SendPropInt was supposed to do this.
>
> But I guess not.
>
> So does anyone know how I can do this?
>
> Thanks :D
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
--
- Benjamin Davison
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders