I've ran into an issue where if I change the Engineer's melee weapon (ex. Gunslinger -> Wrench), the player's buildings get destroyed. I tried changing the
m_hBuilder properties of buildings and I still have the issue. This issue isn't related to TF2Items or the Give Weapon plugin, hence why I'm posting here instead. Anyone have any pointers?
PHP Code:
public TF2Items_OnGiveNamedItem_Post(client, String:classname[], iItemDefinitionIndex, itemLevel, itemQuality, entityIndex)
{
if (!IsItemStock(iItemDefinitionIndex))
CreateTimer(0.1, Timer_RemoveItem, entityIndex);
if (g_clientSetupQueue[client] == INVALID_HANDLE)
g_clientSetupQueue[client] = CreateTimer(0.1, Timer_SetupItems, client);
}
PHP Code:
public Action:Timer_RemoveItem(Handle:timer, any:entityIndex)
{
if (IsValidEntity(entityIndex))
AcceptEntityInput(entityIndex, "kill");
}
PHP Code:
public Action:Timer_SetupItems(Handle:timer, any:client)
{
switch (TF2_GetPlayerClass(client))
{
case TFClass_Scout:
{
TF2Items_GiveWeapon(client, 13);
TF2Items_GiveWeapon(client, 23);
TF2Items_GiveWeapon(client, 0);
}
case TFClass_Soldier:
{
TF2Items_GiveWeapon(client, 18);
TF2Items_GiveWeapon(client, 10);
TF2Items_GiveWeapon(client, 6);
}
case TFClass_Pyro:
{
TF2Items_GiveWeapon(client, 21);
TF2Items_GiveWeapon(client, 12);
TF2Items_GiveWeapon(client, 2);
}
case TFClass_DemoMan:
{
TF2Items_GiveWeapon(client, 19);
TF2Items_GiveWeapon(client, 20);
TF2Items_GiveWeapon(client, 1);
}
case TFClass_Heavy:
{
TF2Items_GiveWeapon(client, 15);
TF2Items_GiveWeapon(client, 11);
TF2Items_GiveWeapon(client, 5);
}
case TFClass_Engineer:
{
TF2Items_GiveWeapon(client, 9);
TF2Items_GiveWeapon(client, 22);
TF2Items_GiveWeapon(client, 7);
TF2Items_GiveWeapon(client, 25);
TF2Items_GiveWeapon(client, 26);
TF2Items_GiveWeapon(client, 28);
}
case TFClass_Medic:
{
TF2Items_GiveWeapon(client, 17);
TF2Items_GiveWeapon(client, 29);
TF2Items_GiveWeapon(client, 8);
}
case TFClass_Sniper:
{
TF2Items_GiveWeapon(client, 14);
TF2Items_GiveWeapon(client, 16);
TF2Items_GiveWeapon(client, 3);
}
case TFClass_Spy:
{
TF2Items_GiveWeapon(client, 24);
TF2Items_GiveWeapon(client, 735);
TF2Items_GiveWeapon(client, 4);
TF2Items_GiveWeapon(client, 27);
TF2Items_GiveWeapon(client, 30);
}
}
g_clientSetupQueue[client] = INVALID_HANDLE;
}