--
[ 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