Skip to content

Exception reported: TF2ItemType handle not created (error 10) #22

@caxanga334

Description

@caxanga334

Description

Plugins using the TF2Items_CreateItem native throws this error.

Error log from Sourcemod.
L 12/26/2025 - 15:01:07: [SM] Exception reported: TF2ItemType handle not created (error 10)
L 12/26/2025 - 15:01:07: [SM] Blaming: tf2items_test.smx
L 12/26/2025 - 15:01:07: [SM] Call stack trace:
L 12/26/2025 - 15:01:07: [SM]   [0] TF2Items_CreateItem
L 12/26/2025 - 15:01:07: [SM]   [1] Line 20, D:\gameservers\tf2_ds_dev\tf\addons\sourcemod\scripting\tf2items_test.sp::Command_GiveItem

Steps to Reproduce

  1. Install a fresh copy of a TF2 dedicated server via SteamCMD.
  2. Install Metamod Source and Sourcemod.
  3. Install the latest TF2Items from here: https://builds.limetech.io/?project=tf2items
  4. Download the latest Sourcepawn include and move it to the scripting/include folder.
  5. Compile and install the test plugin (code attached below).
  6. Start and join the server.
  7. Run the sm_giveitem command.
  8. Observe the server logs.

Test Server Details

'soup' dump
Build Label:          10336138   # Uniquely identifies each build
Network PatchVersion: 10336138   # Determines client and server compatibility
Protocol version:           24   # High level network protocol version
Server version:       10336138
Server AppID:           232250
Loaded plugins:
---------------------
0:	"Metamod:Source 1.12.0-dev+1219"
---------------------
 Metamod:Source Version Information
    Metamod:Source version 1.12.0-dev+1219
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: Valve Server Plugin
    Compiled on: Apr 18 2025 07:49:09
    Built from: https://github.com/alliedmodders/metamod-source/commit/02ee4a3
    Build ID: 1219:02ee4a3
    http://www.metamodsource.net/
Listing 5 plugins:
  [01] SourceMod (1.13.0.7283) by AlliedModders LLC
  [02] TF2 Tools (1.13.0.7283) by AlliedModders LLC
  [03] SDK Hooks (1.13.0.7283) by AlliedModders LLC
  [04] SDK Tools (1.13.0.7283) by AlliedModders LLC
  [05] TF2Items (1.6.4) by Asherkin & AzuiSleet & Damizean
 SourceMod Version Information:
    SourceMod Version: 1.13.0.7283
    SourcePawn Engine: 1.13.0.7283, jit-x86 (build 1.13.0.7283)
    SourcePawn API: v1 = 5, v2 = 16
    Compiled on: Dec 15 2025 14:38:41
    Built from: https://github.com/alliedmodders/sourcemod/commit/6e6f6e74
    Build ID: 7283:6e6f6e74
    http://www.sourcemod.net/
[SM] Displaying 12 extensions:
[01] Automatic Updater (1.13.0.7283): Updates SourceMod gamedata files
[02] Webternet (1.13.0.7283): Extension for interacting with URLs
[03] Accelerator (2.6.0-manual): SRCDS Crash Handler
[04] Console Cleaner (1.4.0): Console warning suppressor
[05] TF2 Tools (1.13.0.7283): TF2 extended functionality
[06] BinTools (1.13.0.7283): Low-level C/C++ Calling API
[07] SDK Hooks (1.13.0.7283): Source SDK Hooks
[08] SDK Tools (1.13.0.7283): Source SDK Tools
[09] Top Menus (1.13.0.7283): Creates sorted nested menus
[10] Client Preferences (1.13.0.7283): Saves client preference settings
[11] SQLite (1.13.0.7283): SQLite Driver
[12] TF2Items (1.6.4): TF2 Item Modifier
[SM] Listing 18 plugins:
  01 "Admin File Reader" (1.13.0.7283) by AlliedModders LLC
  02 "Admin Help" (1.13.0.7283) by AlliedModders LLC
  03 "Admin Menu" (1.13.0.7283) by AlliedModders LLC
  04 "Anti-Flood" (1.13.0.7283) by AlliedModders LLC
  05 "Basic Ban Commands" (1.13.0.7283) by AlliedModders LLC
  06 "Basic Chat" (1.13.0.7283) by AlliedModders LLC
  07 "Basic Comm Control" (1.13.0.7283) by AlliedModders LLC
  08 "Basic Commands" (1.13.0.7283) by AlliedModders LLC
  09 "Basic Info Triggers" (1.13.0.7283) by AlliedModders LLC
  10 "Basic Votes" (1.13.0.7283) by AlliedModders LLC
  11 "Client Preferences" (1.13.0.7283) by AlliedModders LLC
  12 "Fun Commands" (1.13.0.7283) by AlliedModders LLC
  13 "Fun Votes" (1.13.0.7283) by AlliedModders LLC
  14 "Nextmap" (1.13.0.7283) by AlliedModders LLC
  15 "Player Commands" (1.13.0.7283) by AlliedModders LLC
  16 "Reserved Slots" (1.13.0.7283) by AlliedModders LLC
  17 "Sound Commands" (1.13.0.7283) by AlliedModders LLC
  18 "tf2items_test.smx"

Test Plugin Code

Code
#include <sourcemod>
#include <tf2_stocks>
#include <tf2items>

#pragma newdecls required
#pragma semicolon 1

public void OnPluginStart()
{
	RegAdminCmd("sm_giveitem", Command_GiveItem, ADMFLAG_CHEATS, "TF2Items give item test command.");
}

Action Command_GiveItem(int client, int args)
{
	if (!client)
	{
		return Plugin_Handled;
	}

	Handle item = TF2Items_CreateItem(OVERRIDE_ALL);

	if (!item)
	{
		return Plugin_Handled;
	}

	TF2_RemoveWeaponSlot(client, view_as<int>(TFWeaponSlot_Primary));

	TF2Items_SetClassname(item, "tf_weapon_rocketlauncher");
	TF2Items_SetItemIndex(item, 18);
	TF2Items_SetLevel(item, 1);
	TF2Items_SetQuality(item, 6);
	int weapon = TF2Items_GiveNamedItem(client, item);
	EquipPlayerWeapon(client, weapon);

	delete item;

	return Plugin_Handled;
}

Workarounds

I have found two workarounds for this issue.

  • Use an older sourcepawn include (IE: The one that comes with the extension files from builds.limetech.io).
  • Delete the tf2items.autoload from addons/sourcemod/extensions/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions