void CHL2MP_Player::GiveDefaultItems( void ) { EquipSuit(); CBasePlayer::GiveAmmo( 255, "Pistol"); CBasePlayer::GiveAmmo( 45, "SMG1"); CBasePlayer::GiveAmmo( 6, "Buckshot"); CBasePlayer::GiveAmmo( 6, "357" ); GiveNamedItem( "weapon_crowbar" ); GiveNamedItem( "weapon_pistol" ); GiveNamedItem( "weapon_smg1" ); GiveNamedItem( "weapon_physcannon" ); const char *szDefaultWeaponName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_defaultweapon" ); CBaseCombatWeapon *pDefaultWeapon = Weapon_OwnsThisType( szDefaultWeaponName ); if ( pDefaultWeapon ) { Weapon_Switch( pDefaultWeapon ); } else { Weapon_Switch( Weapon_OwnsThisType( "weapon_physcannon" ) ); } }
void CSDKPlayer::CheatImpulseCommands( int iImpulse ) { if ( iImpulse != 101 ) { BaseClass::CheatImpulseCommands( iImpulse ); return ; } gEvilImpulse101 = true; EquipSuit(); GiveNamedItem( "weapon_mp5" ); GiveNamedItem( "weapon_grenade" ); GiveNamedItem( "weapon_shotgun" ); // Give the player everything! GiveAmmo( 90, AMMO_BULLETS ); GiveAmmo( 3, AMMO_GRENADE ); if ( GetHealth() < 100 ) { TakeHealth( 25, DMG_GENERIC ); } gEvilImpulse101 = false; }
//BP On file tous les items et des munitions void CHL2MP_Player::GiveAllItems( void ) { EquipSuit(); CBasePlayer::GiveAmmo( 355, "SMG1"); CBasePlayer::GiveAmmo( 5, "Buckshot"); CBasePlayer::GiveAmmo( 15, "XBowBolt" ); CBasePlayer::GiveAmmo( 15, "Flechette" ); CBasePlayer::GiveAmmo( 10, "RPG_round"); CBasePlayer::GiveAmmo( 100, "357"); CBasePlayer::GiveAmmo( 5, "Grenade" ); CBasePlayer::GiveAmmo( 2, "slam" ); GiveNamedItem( "weapon_flower" ); GiveNamedItem( "weapon_bat" ); GiveNamedItem( "weapon_revolver" ); GiveNamedItem( "weapon_uzi" ); GiveNamedItem( "weapon_bigshotgun" ); GiveNamedItem( "weapon_carebearstare" ); GiveNamedItem( "weapon_flowerlauncher" ); GiveNamedItem( "weapon_tranquilizer" ); GiveNamedItem( "weapon_bazooka" ); GiveNamedItem( "weapon_grenade" ); GiveNamedItem( "weapon_mine" ); }
void CSDKPlayer::Spawn() { SetModel( SDK_PLAYER_MODEL ); //Tony; basically, leave this alone ;) unless you're not using classes or teams, then you can change it to whatever. SetBloodColor( BLOOD_COLOR_RED ); SetMoveType( MOVETYPE_WALK ); RemoveSolidFlags( FSOLID_NOT_SOLID ); //Tony; if we're spawning in active state, equip the suit so the hud works. -- Gotta love base code ! if ( State_Get() == STATE_ACTIVE ) { EquipSuit( false ); //Tony; bleh, don't do this here. // GiveDefaultItems(); } m_hRagdoll = NULL; BaseClass::Spawn(); #if defined ( SDK_USE_STAMINA ) || defined ( SDK_USE_SPRINTING ) m_Shared.SetStamina( 100 ); #endif #if defined ( SDK_USE_TEAMS ) m_bTeamChanged = false; #endif #if defined ( SDK_USE_PRONE ) InitProne(); #endif #if defined ( SDK_USE_SPRINTING ) InitSprinting(); #endif // update this counter, used to not interp players when they spawn m_bSpawnInterpCounter = !m_bSpawnInterpCounter; InitSpeeds(); //Tony; initialize player speeds. SetArmorValue(SpawnArmorValue()); SetContextThink( &CSDKPlayer::SDKPushawayThink, gpGlobals->curtime + PUSHAWAY_THINK_INTERVAL, SDK_PUSHAWAY_THINK_CONTEXT ); pl.deadflag = false; }
void CHL2MP_Player::GiveDefaultItems( void ) { EquipSuit(); //BP En période de construction du mode forts, on ne donne que le physgun if(HL2MPRules()->GetGameType() == GAME_FORTS && HL2MPRules()->IsFortsBuildPhase()) { GiveNamedItem( "weapon_carebearstare" ); Weapon_Switch( Weapon_OwnsThisType( "weapon_carebearstare" ) ); return; } if(HL2MPRules()->IsHumiliation()) { if((HL2MPRules()->IsTeamplay() && HL2MPRules()->GetWinningTeamNumber() == GetTeamNumber()) || (!HL2MPRules()->IsTeamplay() && HL2MPRules()->GetBestPlayer() == this)) GiveNamedItem("weapon_bat"); else GiveNamedItem("weapon_flower"); return; } GiveNamedItem( "weapon_flower" ); if(!HL2MPRules()->OnlyGiveFlower()) { GiveNamedItem( "weapon_uzi" ); CBasePlayer::GiveAmmo( 60, "SMG1"); GiveNamedItem( "weapon_grenade" ); GiveNamedItem( "weapon_grenade" ); GiveNamedItem( "weapon_revolver" ); GiveNamedItem( "weapon_flowerlauncher" ); } const char *szDefaultWeaponName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_defaultweapon" ); CBaseCombatWeapon *pDefaultWeapon = Weapon_OwnsThisType( szDefaultWeaponName ); if ( pDefaultWeapon ) Weapon_Switch( pDefaultWeapon ); else Weapon_Switch( Weapon_OwnsThisType( "weapon_uzi" ) ); }
void CHL2MP_Player::GiveDefaultItems( void ) { EquipSuit(); //GiveNamedItem( "weapon_kungfu" ); CBaseCombatWeapon *pDefault = static_cast<CBaseCombatWeapon*>(GiveNamedItem( "weapon_combatknife" )); Assert( pDefault ); Weapon_Switch( pDefault ); if ( IsBot() ) { CBaseCombatWeapon *pMac11 = static_cast<CBaseCombatWeapon*>(GiveNamedItem( "weapon_mac11" )); Weapon_Switch( pMac11 ); CBasePlayer::GiveAmmo( 128, "Mac11" ); } FileWeaponInfo_t* pInfo = GetFileWeaponInfoFromHandle( LookupWeaponInfoSlot( "weapon_deringer" ) ); if ( pInfo ) CBasePlayer::GiveAmmo( pInfo->iDefaultAmmoPrimary, "Deringer" ); }
void CHL2MP_Player::GiveAllItems( void ) { EquipSuit(); // CBasePlayer::GiveAmmo( 255, "Pistol"); // CBasePlayer::GiveAmmo( 255, "AR2" ); // CBasePlayer::GiveAmmo( 5, "AR2AltFire" ); // CBasePlayer::GiveAmmo( 255, "SMG1"); // CBasePlayer::GiveAmmo( 1, "smg1_grenade"); CBasePlayer::GiveAmmo( 100, "Buckshot"); // CBasePlayer::GiveAmmo( 32, "357" ); CBasePlayer::GiveAmmo( 100, "rpg_round"); CBasePlayer::GiveAmmo( 200, "XBowBolt" ); CBasePlayer::GiveAmmo( 200, "Cells"); // CBasePlayer::GiveAmmo( 1, "grenade" ); // CBasePlayer::GiveAmmo( 2, "slam" ); GiveNamedItem( "weapon_crowbar" ); // GiveNamedItem( "weapon_stunstick" ); // GiveNamedItem( "weapon_pistol" ); // GiveNamedItem( "weapon_357" ); // GiveNamedItem( "weapon_smg1" ); // GiveNamedItem( "weapon_ar2" ); GiveNamedItem( "weapon_shotgun" ); GiveNamedItem( "weapon_shotgundouble" ); GiveNamedItem( "weapon_shaft" ); // GiveNamedItem( "weapon_frag" ); GiveNamedItem( "weapon_nailgun" ); GiveNamedItem( "weapon_nailgunsuper" ); // GiveNamedItem( "weapon_crossbow" ); GiveNamedItem( "weapon_rpg" ); GiveNamedItem( "weapon_grenadelauncher" ); // GiveNamedItem( "weapon_slam" ); }
void CHL2MP_Player::GiveDefaultItems( void ) { EquipSuit(); // CBasePlayer::GiveAmmo( 255, "Pistol"); // CBasePlayer::GiveAmmo( 45, "SMG1"); // CBasePlayer::GiveAmmo( 1, "grenade" ); CBasePlayer::GiveAmmo( 100, "Buckshot"); // CBasePlayer::GiveAmmo( 6, "357" ); CBasePlayer::GiveAmmo( 100, "rpg_round"); CBasePlayer::GiveAmmo( 200, "XBowBolt" ); CBasePlayer::GiveAmmo( 200, "Cells"); GiveNamedItem( "weapon_crowbar" ); GiveNamedItem( "weapon_shotgun" ); GiveNamedItem( "weapon_shotgundouble" ); // GiveNamedItem( "weapon_shaft" ); GiveNamedItem( "weapon_rpg" ); GiveNamedItem( "weapon_grenadelauncher" ); GiveNamedItem( "weapon_nailgun" ); GiveNamedItem( "weapon_nailgunsuper" ); // GiveNamedItem( "weapon_pistol" ); // GiveNamedItem( "weapon_smg1" ); // GiveNamedItem( "weapon_frag" ); // GiveNamedItem( "weapon_physcannon" ); const char *szDefaultWeaponName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_defaultweapon" ); CBaseCombatWeapon *pDefaultWeapon = Weapon_OwnsThisType( szDefaultWeaponName ); if ( pDefaultWeapon ) { Weapon_Switch( pDefaultWeapon ); } else { Weapon_Switch( Weapon_OwnsThisType( "weapon_shotgun" ) ); } }
void CSDKPlayer::CheatImpulseCommands( int iImpulse ) { if ( !sv_cheats->GetBool() ) { return; } if ( iImpulse != 101 ) { BaseClass::CheatImpulseCommands( iImpulse ); return ; } gEvilImpulse101 = true; EquipSuit(); if ( GetHealth() < 100 ) { TakeHealth( 25, DMG_GENERIC ); } gEvilImpulse101 = false; }
void CHL2MP_Player::GiveDefaultItems( void ) { EquipSuit(); CBasePlayer::GiveAmmo( 255, "Pistol"); CBasePlayer::GiveAmmo( 45, "SMG1"); CBasePlayer::GiveAmmo( 1, "grenade" ); CBasePlayer::GiveAmmo( 6, "Buckshot"); CBasePlayer::GiveAmmo( 6, "357" ); if ( GetPlayerModelType() == PLAYER_SOUNDS_METROPOLICE || GetPlayerModelType() == PLAYER_SOUNDS_COMBINESOLDIER ) { GiveNamedItem( "weapon_stunstick" ); } else if ( GetPlayerModelType() == PLAYER_SOUNDS_CITIZEN ) { GiveNamedItem( "weapon_crowbar" ); } GiveNamedItem( "weapon_pistol" ); GiveNamedItem( "weapon_smg1" ); GiveNamedItem( "weapon_frag" ); GiveNamedItem( "weapon_physcannon" ); const char *szDefaultWeaponName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_defaultweapon" ); CBaseCombatWeapon *pDefaultWeapon = Weapon_OwnsThisType( szDefaultWeaponName ); if ( pDefaultWeapon ) { Weapon_Switch( pDefaultWeapon ); } else { Weapon_Switch( Weapon_OwnsThisType( "weapon_physcannon" ) ); } }
void CHL2MP_Player::GiveAllItems( void ) { EquipSuit(); CBasePlayer::GiveAmmo( 255, "Pistol"); CBasePlayer::GiveAmmo( 255, "AR2" ); CBasePlayer::GiveAmmo( 5, "AR2AltFire" ); CBasePlayer::GiveAmmo( 255, "SMG1"); CBasePlayer::GiveAmmo( 1, "smg1_grenade"); CBasePlayer::GiveAmmo( 255, "Buckshot"); CBasePlayer::GiveAmmo( 32, "357" ); CBasePlayer::GiveAmmo( 3, "rpg_round"); CBasePlayer::GiveAmmo( 1, "grenade" ); CBasePlayer::GiveAmmo( 2, "slam" ); GiveNamedItem( "weapon_crowbar" ); GiveNamedItem( "weapon_stunstick" ); GiveNamedItem( "weapon_pistol" ); GiveNamedItem( "weapon_357" ); GiveNamedItem( "weapon_smg1" ); GiveNamedItem( "weapon_ar2" ); GiveNamedItem( "weapon_shotgun" ); GiveNamedItem( "weapon_frag" ); GiveNamedItem( "weapon_crossbow" ); GiveNamedItem( "weapon_rpg" ); GiveNamedItem( "weapon_slam" ); GiveNamedItem( "weapon_physcannon" ); }
void CHL2MP_Player::GiveAllItems( void ) { EquipSuit(); //DHL - Skillet CBasePlayer::GiveAmmo( 120, "Beretta" ); CBasePlayer::GiveAmmo( 80, "Deagle" ); CBasePlayer::GiveAmmo( 80, "SAA" ); CBasePlayer::GiveAmmo( 80, "Deringer" ); CBasePlayer::GiveAmmo( 300, "Mac11" ); CBasePlayer::GiveAmmo( 200, "AK47" ); CBasePlayer::GiveAmmo( 125, "Winchester" ); CBasePlayer::GiveAmmo( 200, "Thompson" ); CBasePlayer::GiveAmmo( 50, "MosinNagant" ); CBasePlayer::GiveAmmo( 75, "Remington" ); CBasePlayer::GiveAmmo( 50, "SawedOff" ); //HL2: /*CBasePlayer::GiveAmmo( 255, "Pistol"); CBasePlayer::GiveAmmo( 255, "AR2" ); CBasePlayer::GiveAmmo( 5, "AR2AltFire" ); CBasePlayer::GiveAmmo( 255, "SMG1"); CBasePlayer::GiveAmmo( 1, "smg1_grenade"); CBasePlayer::GiveAmmo( 255, "Buckshot"); CBasePlayer::GiveAmmo( 32, "357" ); CBasePlayer::GiveAmmo( 3, "rpg_round"); CBasePlayer::GiveAmmo( 1, "grenade" ); CBasePlayer::GiveAmmo( 2, "slam" );*/ //DHL - Skillet //Kung Fu! //GiveNamedItem( "weapon_kungfu" ); //Melee GiveNamedItem( "weapon_katana" ); GiveNamedItem( "weapon_combatknife" ); GiveNamedItem( "weapon_baseballbat" ); //Handguns GiveNamedItem( "weapon_beretta" ); GiveNamedItem( "weapon_deagle" ); GiveNamedItem( "weapon_saa" ); //GiveNamedItem( "weapon_deringer" ); //Automatics GiveNamedItem( "weapon_ak47" ); GiveNamedItem( "weapon_mac11" ); GiveNamedItem( "weapon_thompson" ); //Shotguns GiveNamedItem( "weapon_sawedoff" ); GiveNamedItem( "weapon_remington" ); //Special? GiveNamedItem( "weapon_frag" ); //GiveNamedItem( "weapon_crossbow" ); //GiveNamedItem( "weapon_rpg" ); //GiveNamedItem( "weapon_slam" ); //Rifles GiveNamedItem( "weapon_mosinnagant" ); GiveNamedItem( "weapon_winchester" ); }