Is there a way to get the dev attributes recognized by TF2 Items Info, or is that beyond the scope of this plugin?
I was trying to get some of these to work with the Uber Upgrades mod without success. It led me to do some testing of attributes with TF2II where I learned they aren't recognized.
PHP Code:
#include <sourcemod>
#include <tf2itemsinfo>
#pragma semicolon 1
#pragma newdecls required
#define PLUGIN_VERSION "1.0"
public Plugin myinfo =
{
name = "[TF2] Check Attributes",
author = "PC Gamer",
description = "Check Attribute to see it can be read with TF2ItemsInfo",
version = PLUGIN_VERSION,
url = "https://forums.alliedmods.net/"
}
public void OnPluginStart()
{
RegAdminCmd("sm_checkattribute", Command_CheckAtt, ADMFLAG_SLAY, "Test an Attribute");
}
public Action Command_CheckAtt(int client, int args)
{
char arg1[32];
if (args < 1)
{
ReplyToCommand(client, "checkattribute <attribute id>");
ReplyToCommand(client, "new dev attribute ids: 4324-4378");
return Plugin_Handled;
}
GetCmdArg(1, arg1, sizeof(arg1));
int AttribID = StringToInt(arg1);
if (TF2II_IsValidAttribID(AttribID))
{
char AttribName[96];
TF2II_GetAttributeNameByID(AttribID, AttribName, 96);
PrintToServer("Attribute ID: %i, Name: %s", AttribID, AttribName);
char AttribClass[96];
TF2II_GetAttribClass(AttribID, AttribClass, 96);
PrintToServer("Attribute ID: %i, Class: %s", AttribID, AttribClass);
char AttribFormat[96];
TF2II_GetAttribDescrFormat(AttribID, AttribFormat, 96);
PrintToServer("Attribute ID: %i, Format: %s", AttribID, AttribFormat);
char AttribDescr[96];
TF2II_GetAttribDescrString(AttribID, AttribDescr, 96);
PrintToServer("Attribute ID: %i, Description String: %s", AttribID, AttribDescr);
int AttribEffect;
AttribEffect = TF2II_GetAttribEffectType(AttribID);
if(AttribEffect == 1)
{
PrintToServer("Attribute ID: %i, Effect Type: Positive", AttribID);
}
if(AttribEffect == -1)
{
PrintToServer("Attribute ID: %i, Effect Type: Negative", AttribID);
}
if(AttribEffect == 0)
{
PrintToServer("Attribute ID: %i, Effect Type: Not Listed", AttribID);
}
}
else
{
PrintToServer("Attribute ID %d is not valid", AttribID);
}
return Plugin_Handled;
}
/*
---Available TF2II Attribute Natives---
CreateNative( "TF2II_IsValidAttribID", Native_IsValidAttribID );
CreateNative( "TF2II_GetAttribName", Native_GetAttribName );
CreateNative( "TF2II_GetAttribClass", Native_GetAttribClass );
CreateNative( "TF2II_GetAttribDispName", Native_GetAttribDispName );
CreateNative( "TF2II_GetAttribMinValue", Native_GetAttribMinValue );
CreateNative( "TF2II_GetAttribMaxValue", Native_GetAttribMaxValue );
CreateNative( "TF2II_GetAttribGroup", Native_GetAttribGroup );
CreateNative( "TF2II_GetAttribDescrString", Native_GetAttribDescrString );
CreateNative( "TF2II_GetAttribDescrFormat", Native_GetAttribDescrFormat );
CreateNative( "TF2II_HiddenAttrib", Native_HiddenAttrib );
CreateNative( "TF2II_GetAttribEffectType", Native_GetAttribEffectType );
CreateNative( "TF2II_AttribStoredAsInteger", Native_AttribStoredAsInteger );
CreateNative( "TF2II_AttribHasProperty", Native_AttribHasProperty );
*/