Raised This Month: $ Target: $400
 0% 

"unknown entity type tf_weapon_shotgun!"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 05-29-2013 , 16:26   "unknown entity type tf_weapon_shotgun!"
Reply With Quote #1

While testing a plugin, I noticed the following error.

Code:
Attempted to create unknown entity type tf_weapon_shotgun!
Failed to generate base item: tf_weapon_shotgun
L 05/30/2013 - 06:06:10: [TF2ITEMS] ---------------------------------------
L 05/30/2013 - 06:06:10: [TF2ITEMS] >>> szClassname = tf_weapon_shotgun
L 05/30/2013 - 06:06:10: [TF2ITEMS] >>> iItemDefinitionIndex = 10
L 05/30/2013 - 06:06:10: [TF2ITEMS] >>> iEntityQuality = 6
L 05/30/2013 - 06:06:10: [TF2ITEMS] >>> iEntityLevel = 1
L 05/30/2013 - 06:06:10: [TF2ITEMS] ---------------------------------------
L 05/30/2013 - 06:06:10: [SM] Native "TF2Items_GiveNamedItem" reported: Item is NULL. File a bug report if you are sure you set all the data correctly. (Try the FORCE_GENERATION flag.)
Resulted in both server crashes and tf2items to partially stop working.

PHP Code:
new def_sol_sec_itemid 10;

public 
ItemApply(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
TFClassType:class = TFClassType:TF2_GetPlayerClass(client);
    
decl slotid[11];
    if (class == 
TFClass_Soldier)
    {
        
slotid[1] = GetPlayerWeaponSlot(client1);
        if (
slotid[1] == -&& (GetConVarInt(disable_flags_solly) & 2) == 0)
        {
            new 
Handle:item TF2Items_CreateItem(OVERRIDE_ALL FORCE_GENERATION);
            
TF2Items_SetClassname(item"tf_weapon_shotgun");
            
TF2Items_SetItemIndex(itemdef_sol_sec_itemid);
            
TF2Items_SetQuality(item6);
            
TF2Items_SetLevel(item1);
            
TF2Items_SetNumAttributes(item0);
            
slotid[1] = TF2Items_GiveNamedItem(clientitem);
            
EquipPlayerWeapon(clientslotid[1]);
            
CloseHandle(item);
        }
    }

I have code just like this that works for the Scout, perfectly. The issue only seems to happen with the shotgun. I also tried using id 199.

edit: forgot to post the versions

Code:
Metamod:Source version 1.9.3-dev
Build ID: 819:7c5b4fa4ccdc-dev
Loaded As: Valve Server Plugin
Compiled on: May 13 2013
Plugin interface version: 15:14
SourceHook version: 5:5
Code:
SourceMod Version: 1.5.0-dev+3841
SourcePawn Engine: SourcePawn 1.1, jit-x86 (build 1.5.0-dev+3841)
SourcePawn API: v1 = 4, v2 = 4
Compiled on: May 16 2013 08:01:53
Build ID: 3841:5f829335d94a
Code:
Title: [TF2Items] Manager ([TF2Items] Manager)
Author: Damizean & Asherkin
Version: 1.4.1

Last edited by CoolJosh3k; 05-29-2013 at 16:33. Reason: forgot to post version
CoolJosh3k is offline
 



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 02:50.


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