Removed TF2_GivePlayerWeapon() and TF2_EquipPlayerClassWeapons() stocks as they no longer work at all
The 'weapons' paramater in the TF2_SetPlayerClass() class is now ignored since it no longer works --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402237
This commit is contained in:
parent
20d12fad9f
commit
076b5191c9
@ -102,7 +102,7 @@ stock TFClassType:TF2_GetPlayerClass(client)
|
||||
*
|
||||
* @param client Player's index.
|
||||
* @param class TFClassType class symbol.
|
||||
* @param weapons If true, changes the players weapon set to that of the new class.
|
||||
* @param weapons This paramater is ignored.
|
||||
* @param persistant If true changes the players desired class so the change stays after death.
|
||||
* @noreturn
|
||||
* @error Invalid client index.
|
||||
@ -115,12 +115,6 @@ stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true, bool:pers
|
||||
{
|
||||
SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class);
|
||||
}
|
||||
|
||||
if (weapons && IsPlayerAlive(client))
|
||||
{
|
||||
TF2_RemoveAllWeapons(client);
|
||||
TF2_EquipPlayerClassWeapons(client, class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -223,105 +217,3 @@ stock TF2_RemoveAllWeapons(client)
|
||||
TF2_RemoveWeaponSlot(client, i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives a named weapon to a client
|
||||
*
|
||||
* @param client Player's index.
|
||||
* @param weapon Weapon name
|
||||
* @return False if weapon could not be created, true on success
|
||||
* @error Invalid client index or lack of mod support
|
||||
*/
|
||||
stock bool:TF2_GivePlayerWeapon(client, const String:weapon[])
|
||||
{
|
||||
new weaponIndex = GivePlayerItem(client, weapon);
|
||||
if (weaponIndex == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
EquipPlayerWeapon(client, weaponIndex);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Equips a client with a class's weapons. This does not remove existing weapons.
|
||||
*
|
||||
* Note: Some class specific items such tf_weapon_pda_engineer_build are only given
|
||||
* if the client is the correct class.
|
||||
*
|
||||
* @param client Player's index.
|
||||
* @param class TFClasssType class symbol.
|
||||
* @noreturn
|
||||
*/
|
||||
stock TF2_EquipPlayerClassWeapons(client, TFClassType:class)
|
||||
{
|
||||
switch(class)
|
||||
{
|
||||
case TFClass_Scout:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_scattergun");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_pistol_scout");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_bat");
|
||||
}
|
||||
case TFClass_Sniper:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_sniperrifle");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_smg");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_club");
|
||||
}
|
||||
case TFClass_Soldier:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_rocketlauncher");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_shotgun_soldier");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_shovel");
|
||||
}
|
||||
case TFClass_DemoMan:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_pipebomblauncher");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_grenadelauncher");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_bottle");
|
||||
}
|
||||
case TFClass_Medic:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_syringegun_medic");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_medigun");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_bonesaw");
|
||||
}
|
||||
case TFClass_Heavy:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_minigun");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_shotgun_hwg");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_fists");
|
||||
}
|
||||
case TFClass_Pyro:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_flamethrower");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_shotgun_pyro");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_fireaxe");
|
||||
}
|
||||
case TFClass_Spy:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_revolver");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_knife");
|
||||
|
||||
if (TF2_GetPlayerClass(client) != TFClass_Spy)
|
||||
return;
|
||||
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_pda_spy");
|
||||
}
|
||||
case TFClass_Engineer:
|
||||
{
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_shotgun_primary");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_pistol");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_wrench");
|
||||
|
||||
if (TF2_GetPlayerClass(client) != TFClass_Engineer)
|
||||
return;
|
||||
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_pda_engineer_build");
|
||||
TF2_GivePlayerWeapon(client, "tf_weapon_pda_engineer_destroy");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user