Raised This Month: $ Target: $400
 0% 

Unusual effects don't work on weapon ?!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Erreur 500
Senior Member
Join Date: Aug 2012
Location: Paris, France
Old 10-22-2015 , 11:31   Unusual effects don't work on weapon ?!
Reply With Quote #1

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_hItem1);
}

public 
Action:TF2Items_OnGiveNamedItem(iClientString: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_hItem01342.0);
    
TF2Items_SetQuality(g_hItem4);
        
    
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.
__________________
My public creation : PortalMod - Free Duels - Unusual Effects - Particle fireworks - !stuck

Need private plugin ? We can found an agreement !
Steam : Erreur 500

Last edited by Erreur 500; 10-22-2015 at 11:33.
Erreur 500 is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode