You could do something like this as well:
Code:
pan = 264;
public OnPluginStart()
{
RegAdminCmd("sm_pan", Command_Pan, ADMFLAG_CUSTOM1);
}
public Action:Command_Pan(client, args)
{
new weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if (IsPlayerAlive(1) && GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex") != pan && !TF2_IsPlayerInCondition(client, TFCond_Taunting) && TF2_GetPlayerClass(client) != TFClass_Spy)
{
TF2Items_GiveWeapon(client, pan);
}
else if (TF2_GetPlayerClass(client) == TFClass_Spy)
{
PrintToChat(client, "[SM] You can't receive this weapon as Spy.")
}
return Plugin_Handled;
}