mabey you only have this code in the server project, cause if you had
#include "sdk_player.h" in the client included code she'd back fire :p

it's good to use the same shared code for the client & sever, that's
how FX_FireBullets is setup to work. to do this, add your glock.cpp to
your client project and fix it so it includes "sdk_player.h" on the
server and "c_sdk_player.h" on the client, etc..

i hope this helps mate :-)

Teddy
http://dystopia-mod.com/

On Tue, 22 Feb 2005 19:02:44 +1000, Draco <[EMAIL PROTECTED]> wrote:
> nope, no client dll ifdefs in the file except the reload function(the
> part that resets FOV)
> heres my glock cpp file
>
> //========= Copyright � 1996-2005, Valve Corporation, All rights
> reserved. ============//
> //
> // Purpose:
> //
> //=============================================================================//
>
> #include "cbase.h"
> //#include "weapon_sdkbase.h"
> #include "weapon_glock.h"
> #include "sdk_fx_shared.h"
> #include "sdk_player.h"
>
> IMPLEMENT_SERVERCLASS_ST(CWeaponGlock, DT_WeaponGlock)
> END_SEND_TABLE()
>
> LINK_ENTITY_TO_CLASS( weapon_glock, CWeaponGlock );
> PRECACHE_WEAPON_REGISTER( weapon_glock );
>
> BEGIN_PREDICTION_DATA( CWeaponGlock )
> END_PREDICTION_DATA()
>
> CWeaponGlock::CWeaponGlock()
> {
> }
>
> bool CWeaponGlock::Deploy( )
> {
>         CSDKPlayer *pPlayer = GetPlayerOwner();
>         pPlayer->m_iShotsFired = 0;
>
>         return BaseClass::Deploy();
> }
>
> bool CWeaponGlock::Reload( )
> {
>         CSDKPlayer *pPlayer = GetPlayerOwner();
>
>         if (pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0)
>                 return false;
>
>         int iResult = DefaultReload( GetMaxClip1(), GetMaxClip2(), 
> ACT_VM_RELOAD );
>         if ( !iResult )
>                 return false;
>
>         pPlayer->SetAnimation( PLAYER_RELOAD );
>
> #ifndef CLIENT_DLL
>         if ((iResult) && (pPlayer->GetFOV() != pPlayer->GetDefaultFOV()))
>         {
>                 pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV() );
>         }
> #endif
>
>         pPlayer->m_iShotsFired = 0;
>
>         return true;
> }
>
> void CWeaponGlock::PrimaryAttack( void )
> {
>         const CSDKWeaponInfo &pWeaponInfo = GetSDKWpnData();
>         CSDKPlayer *pPlayer = GetPlayerOwner();
>
>         float flCycleTime = pWeaponInfo.m_flCycleTime;
>
>         bool bPrimaryMode = true;
>
>         float flSpread = 0.01f;
>
>         pPlayer->m_iShotsFired++;
>
>         // Out of ammo?
>         if ( m_iClip1 <= 0 )
>         {
>                 if (m_bFireOnEmpty)
>                 {
>                         PlayEmptySound();
>                         m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
>                 }
>         }
>
>         SendWeaponAnim( ACT_VM_PRIMARYATTACK );
>
>         m_iClip1--;
>
>         // player "shoot" animation
>         pPlayer->SetAnimation( PLAYER_ATTACK1 );
>
>         FX_FireBullets(
>                 pPlayer->entindex(),
>                 pPlayer->Weapon_ShootPosition(),
>                 pPlayer->EyeAngles() + pPlayer->GetPunchAngle(),
>                 GetWeaponID(),
>                 bPrimaryMode?Primary_Mode:Secondary_Mode,
>                 CBaseEntity::GetPredictionRandomSeed() & 255,
>                 flSpread );
>
>         pPlayer->DoMuzzleFlash();
>
>         m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime 
> + 0.3;
>
>         if (!m_iClip1 && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) <= 0)
>         {
>                 // HEV suit - indicate out of ammo condition
>                 pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
>         }
>
>         // start idle animation in 5 seconds
>         SetWeaponIdleTime( gpGlobals->curtime + 5.0 );
> }
>
> void CWeaponGlock::SecondaryAttack( void )
> {
>         const CSDKWeaponInfo &pWeaponInfo = GetSDKWpnData();
>         CSDKPlayer *pPlayer = GetPlayerOwner();
>
>         float flCycleTime = pWeaponInfo.m_flCycleTime;
>
>         bool bPrimaryMode = false;
>
>         float flSpread = 0.05f;
>
>         pPlayer->m_iShotsFired++;
>
>         // Out of ammo?
>         if ( m_iClip1 <= 0 )
>         {
>                 if (m_bFireOnEmpty)
>                 {
>                         PlayEmptySound();
>                         m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
>                 }
>         }
>
>         SendWeaponAnim( ACT_VM_SECONDARYATTACK );
>
>         m_iClip1--;
>
>         // player "shoot" animation
>         pPlayer->SetAnimation( PLAYER_ATTACK1 );
>
>         FX_FireBullets(
>                 pPlayer->entindex(),
>                 pPlayer->Weapon_ShootPosition(),
>                 pPlayer->EyeAngles() + pPlayer->GetPunchAngle(),
>                 GetWeaponID(),
>                 bPrimaryMode?Primary_Mode:Secondary_Mode,
>                 CBaseEntity::GetPredictionRandomSeed() & 255,
>                 flSpread );
>
>         pPlayer->DoMuzzleFlash();
>
>         m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime 
> + 0.2;
>
>         if (!m_iClip1 && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) <= 0)
>         {
>                 // HEV suit - indicate out of ammo condition
>                 pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
>         }
>
>         // start idle animation in 5 seconds
>         SetWeaponIdleTime( gpGlobals->curtime + 5.0 );
> }
>
> void CWeaponGlock::WeaponIdle()
> {
>         if (m_flTimeWeaponIdle > gpGlobals->curtime)
>                 return;
>
>         // only idle if the slid isn't back
>         if ( m_iClip1 != 0 )
>         {
>                 SetWeaponIdleTime( gpGlobals->curtime + 5.0f );
>                 SendWeaponAnim( ACT_VM_IDLE );
>         }
> }
>
> anyone see the problem?
>
>
> --
> **********************
> Draco
> Coder for Perfect Dark and Kreedz Climbing
> http://perfectdark.game-mod.net
>
> _______________________________________________
> 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