Raised This Month: $ Target: $400
 0% 

Random error that I can't figure out.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Warrior 7
Junior Member
Join Date: Aug 2012
Old 08-22-2012 , 21:54   Random error that I can't figure out.
Reply With Quote #1

Right, so I'm attempting to build a utility plugin for TF2 that strips players of their weapons, then gives them a no-damage Conscientious Objector so they can still hit buttons in the level.

The problem is, no matter what I do, TF2Items_GiveNamedItem fails, and says the usual thing about "Item is NULL." The problem is, I've looked over this and can't find anything wrong with it. Is there something wrong with my code or is it a bug?

Code:
public Action:Command_BuildProtectOn(client, args)
{
    StripWeapons(client);
    new Handle:hItem = TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
    if (hItem != INVALID_HANDLE)
    {
        TF2Items_SetClassname(hItem, "saxxy");
        TF2Items_SetItemIndex(hItem, 474);
        TF2Items_SetLevel(hItem, 1);
        TF2Items_SetQuality(hItem, 6);
        TF2Items_SetNumAttributes(hItem, 2);
        TF2Items_SetAttribute(hItem, 0, 137, 0.0);
        TF2Items_SetAttribute(hItem, 1, 138, 0.0);
        new weapon = TF2Items_GiveNamedItem(client, hItem);
        EquipPlayerWeapon(client, weapon);
    }
    CloseHandle(hItem);
    return Plugin_Handled;
}

Last edited by Warrior 7; 08-22-2012 at 21:59.
Warrior 7 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 20:55.


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