void CHL1MP_Player::GiveDefaultItems( void ) { GiveNamedItem( "weapon_crowbar" ); GiveNamedItem( "weapon_glock" ); CBasePlayer::GiveAmmo( 68, "9mmRound" ); }
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; }
//Tony; this is where default items go when not using playerclasses! void CSDKPlayer::GiveDefaultItems() { #if !defined ( SDK_USE_PLAYERCLASSES ) if ( State_Get() == STATE_ACTIVE ) { CBasePlayer::GiveAmmo( 30, "pistol"); CBasePlayer::GiveAmmo( 30, "mp5"); CBasePlayer::GiveAmmo( 12, "shotgun"); CBasePlayer::GiveAmmo( 5, "grenades" ); GiveNamedItem( "weapon_pistol" ); GiveNamedItem( "weapon_mp5" ); GiveNamedItem( "weapon_shotgun" ); GiveNamedItem( "weapon_crowbar" ); GiveNamedItem( "weapon_grenade" ); } #endif }
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" ); }
//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( 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_bazooka" ); GiveNamedItem( "weapon_grenade" ); GiveNamedItem( "weapon_mine" ); }
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::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" ) ); } }
/** * Debug command to give a named weapon */ void CCSBot::GiveWeapon( const char *weaponAlias ) { const char *translatedAlias = GetTranslatedWeaponAlias( weaponAlias ); char wpnName[128]; Q_snprintf( wpnName, sizeof( wpnName ), "weapon_%s", translatedAlias ); WEAPON_FILE_INFO_HANDLE hWpnInfo = LookupWeaponInfoSlot( wpnName ); if ( hWpnInfo == GetInvalidWeaponInfoHandle() ) { return; } CCSWeaponInfo *pWeaponInfo = dynamic_cast< CCSWeaponInfo* >( GetFileWeaponInfoFromHandle( hWpnInfo ) ); if ( !pWeaponInfo ) { return; } if ( !Weapon_OwnsThisType( wpnName ) ) { CBaseCombatWeapon *pWeapon = Weapon_GetSlot( pWeaponInfo->iSlot ); if ( pWeapon ) { if ( pWeaponInfo->iSlot == WEAPON_SLOT_PISTOL ) { DropPistol(); } else if ( pWeaponInfo->iSlot == WEAPON_SLOT_RIFLE ) { DropRifle(); } } } GiveNamedItem( wpnName ); }
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" ); }
void CHL1_Player::CheatImpulseCommands( int iImpulse ) { switch( iImpulse ) { case 101: gEvilImpulse101 = true; GiveNamedItem( "item_suit" ); GiveNamedItem( "weapon_physgun" ); GiveNamedItem( "weapon_crowbar" ); GiveNamedItem( "weapon_glock" ); GiveNamedItem( "weapon_357" ); GiveNamedItem( "weapon_shotgun" ); GiveNamedItem( "weapon_mp5" ); GiveNamedItem( "weapon_satchel" ); GiveNamedItem( "weapon_rpg" ); GiveNamedItem( "weapon_crossbow" ); GiveNamedItem( "weapon_egon" ); GiveNamedItem( "weapon_tripmine" ); GiveNamedItem( "weapon_gauss" ); GiveNamedItem( "weapon_handgrenade" ); GiveNamedItem( "weapon_snark" ); GiveNamedItem( "weapon_hornetgun" ); GiveAmmo( 250, "9mmRound" ); GiveAmmo( 36, "357Round" ); GiveAmmo( 125, "Buckshot" ); GiveAmmo( 10, "MP5_grenade" ); GiveAmmo( 5, "RPG_Rocket" ); GiveAmmo( 50, "XBowBolt" ); GiveAmmo( 100, "Uranium" ); GiveAmmo( 10, "Grenade" ); GiveAmmo( 8, "Hornet" ); GiveAmmo( 15, "Snark" ); GiveAmmo( 5, "TripMine" ); GiveAmmo( 5, "Satchel" ); gEvilImpulse101 = false; break; case 0: default: BaseClass::CheatImpulseCommands( iImpulse ); } }
//========================================================= //========================================================= void CBasePlayer::CheatImpulseCommands( int iImpulse ) { if( !UTIL_CheatsAllowed() ) { return; } switch( iImpulse ) { case 76: { if( !g_bPrecacheGrunt ) { g_bPrecacheGrunt = true; ALERT( at_console, "You must now restart to use Grunt-o-matic.\n" ); } else { UTIL_MakeVectors( Vector( 0, GetViewAngle().y, 0 ) ); Create( "monster_human_grunt", GetAbsOrigin() + gpGlobals->v_forward * 128, GetAbsAngles() ); } break; } case 101: { gEvilImpulse101 = true; GiveNamedItem( "item_suit" ); GiveNamedItem( "item_battery" ); GiveNamedItem( "weapon_crowbar" ); GiveNamedItem( "weapon_9mmhandgun" ); GiveNamedItem( "ammo_9mmclip" ); GiveNamedItem( "weapon_shotgun" ); GiveNamedItem( "ammo_buckshot" ); GiveNamedItem( "weapon_9mmAR" ); GiveNamedItem( "ammo_9mmAR" ); GiveNamedItem( "ammo_ARgrenades" ); GiveNamedItem( "weapon_handgrenade" ); GiveNamedItem( "weapon_tripmine" ); GiveNamedItem( "weapon_357" ); GiveNamedItem( "ammo_357" ); GiveNamedItem( "weapon_crossbow" ); GiveNamedItem( "ammo_crossbow" ); GiveNamedItem( "weapon_egon" ); GiveNamedItem( "weapon_gauss" ); GiveNamedItem( "ammo_gaussclip" ); GiveNamedItem( "weapon_rpg" ); GiveNamedItem( "ammo_rpgclip" ); GiveNamedItem( "weapon_satchel" ); GiveNamedItem( "weapon_snark" ); GiveNamedItem( "weapon_hornetgun" ); #if USE_OPFOR GiveNamedItem( "weapon_knife" ); GiveNamedItem( "weapon_pipewrench" ); GiveNamedItem( "weapon_grapple" ); GiveNamedItem( "weapon_eagle" ); GiveNamedItem( "weapon_m249" ); GiveNamedItem( "weapon_displacer" ); GiveNamedItem( "weapon_sniperrifle" ); GiveNamedItem( "weapon_sporelauncher" ); GiveNamedItem( "weapon_shockrifle" ); GiveNamedItem( "ammo_556" ); GiveNamedItem( "ammo_762" ); #endif gEvilImpulse101 = false; break; } case 102: { // Gibbage!!! CGib::SpawnRandomGibs( this, 1, 1 ); break; } case 103: { // What the hell are you doing? auto pEntity = UTIL_FindEntityForward( this ); if( pEntity ) { CBaseMonster *pMonster = pEntity->MyMonsterPointer(); if( pMonster ) pMonster->ReportAIState(); } break; } case 104: { // Dump all of the global state varaibles (and global entity names) gGlobalState.DumpGlobals(); break; } case 105:// player makes no sound for monsters to hear. { if( m_fNoPlayerSound ) { ALERT( at_console, "Player is audible\n" ); m_fNoPlayerSound = false; } else { ALERT( at_console, "Player is silent\n" ); m_fNoPlayerSound = true; } break; } case 106: { // Give me the classname and targetname of this entity. auto pEntity = UTIL_FindEntityForward( this ); if( pEntity ) { ALERT( at_console, "Classname: %s", pEntity->GetClassname() ); if( pEntity->HasTargetname() ) { ALERT( at_console, " - Targetname: %s\n", pEntity->GetTargetname() ); } else { ALERT( at_console, " - TargetName: No Targetname\n" ); } ALERT( at_console, "Model: %s\n", pEntity->GetModelName() ); if( HasGlobalName() ) ALERT( at_console, "Globalname: %s\n", pEntity->GetGlobalName() ); } break; } case 107: { TraceResult tr; CBaseEntity* pWorld = CWorld::GetInstance(); Vector start = GetAbsOrigin() + GetViewOffset(); Vector end = start + gpGlobals->v_forward * 1024; UTIL_TraceLine( start, end, ignore_monsters, edict(), &tr ); if( tr.pHit ) pWorld = CBaseEntity::Instance( tr.pHit ); const texture_t* pTexture = UTIL_TraceTexture( pWorld, start, end ); if( pTexture ) ALERT( at_console, "Texture: %s\n", pTexture->name ); break; } case 195:// show shortest paths for entire level to nearest node { Create( "node_viewer_fly", GetAbsOrigin(), GetAbsAngles() ); break; } case 196:// show shortest paths for entire level to nearest node { Create( "node_viewer_large", GetAbsOrigin(), GetAbsAngles() ); break; } case 197:// show shortest paths for entire level to nearest node { Create( "node_viewer_human", GetAbsOrigin(), GetAbsAngles() ); break; } case 199:// show nearest node and all connections { ALERT( at_console, "%d\n", WorldGraph.FindNearestNode( GetAbsOrigin(), bits_NODE_GROUP_REALM ) ); WorldGraph.ShowNodeConnections( WorldGraph.FindNearestNode( GetAbsOrigin(), bits_NODE_GROUP_REALM ) ); break; } case 202:// Random blood splatter { UTIL_MakeVectors( GetViewAngle() ); TraceResult tr; UTIL_TraceLine( GetAbsOrigin() + GetViewOffset(), GetAbsOrigin() + GetViewOffset() + gpGlobals->v_forward * 128, ignore_monsters, ENT( pev ), &tr ); if( tr.flFraction != 1.0 ) {// line hit something, so paint a decal auto pBlood = static_cast< CBloodSplat* >( UTIL_CreateNamedEntity( "blood_splat" ) ); pBlood->CreateSplat( this ); } break; } case 203:// remove creature. { auto pEntity = UTIL_FindEntityForward( this ); if( pEntity ) { if( pEntity->GetTakeDamageMode() != DAMAGE_NO ) pEntity->SetThink( &CBaseEntity::SUB_Remove ); } break; } } }