Does anyone has an idea why since the last TF2 update (invasion), unusual effects on weapons don't work ?
I explain:
If you set unusual effects on player weapons, effect will appear the first time, but when you switch to an other weapon, effects will appear less than 1 sec and disappear ...
But if you look, the 3D character at the below left of your screen, it show the unusual effect! But there is no effect on your weapon ...
Else unusual effects work correctly on hat and misc.
Here a picture of the problem (first time = works):
When you switch (no effect on weapon):

Like you can see effect appear at the below left of your screen, but there is nothing on your item!
Code I used to test:
PHP Code:
#include <sourcemod>
#include <tf2>
#include <tf2_stocks>
#include <tf2items>
#define PLUGIN_NAME "Unusual tf2item test"
#define PLUGIN_AUTHOR "Erreur 500"
#define PLUGIN_DESCRIPTION "Add Unusual effects on your weapons (test)"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_CONTACT "[email protected]"
new Handle:g_hItem = INVALID_HANDLE;
public Plugin:myinfo =
{
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = PLUGIN_CONTACT
};
public OnPluginStart()
{
CreateConVar("unusualtest_version", PLUGIN_VERSION, "Unusual test version", FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_REPLICATED);
g_hItem = TF2Items_CreateItem(OVERRIDE_ATTRIBUTES | PRESERVE_ATTRIBUTES);
TF2Items_SetNumAttributes(g_hItem, 1);
}
public Action:TF2Items_OnGiveNamedItem(iClient, String:classname[], iItemDefinitionIndex, &Handle:hItem)
{
if(!IsValidClient(iClient)) return Plugin_Continue;
if(IsFakeClient(iClient)) return Plugin_Continue;
if(iItemDefinitionIndex == 739 || iItemDefinitionIndex == 142) // Blacklisted weapon due to crash.
return Plugin_Continue;
if(StrEqual(classname, "tf_wearable"))
return Plugin_Continue;
TF2Items_SetAttribute(g_hItem, 0, 134, 2.0);
TF2Items_SetQuality(g_hItem, 4);
hItem = g_hItem;
return Plugin_Changed;
}
stock bool:IsValidClient(iClient)
{
if (iClient <= 0) return false;
if (iClient > MaxClients) return false;
return IsClientInGame(iClient);
}
Ps: I use the last TF2Item snapshot.
__________________