Raised This Month: $350 Target: $400
 87%   Almost there!

[CS:GO] GiveNamedItem tool (for valve items plugins) [Updated 19-Nov-2019]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Plugin ID:
6770
Plugin Version:
6.2.2
Plugin Category:
Technical/Development
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 10-20-2019 , 15:27   [CS:GO] GiveNamedItem tool (for valve items plugins) [Updated 19-Nov-2019]
    Reply With Quote #1

    Description:

    Based on this plugin with multiple changes and rewrittes for give a good natives for use in valve plugins (like my !ws and !knife plugins).

    My !ws plugin: https://forums.alliedmods.net/showthread.php?t=261288
    My knife plugin: https://forums.alliedmods.net/showthread.php?t=319241


    Natives:
    PHP Code:
    const int INVALID_PAINTKIT = -1;
    const 
    int PAINTKIT_PLAYERS 0;
    const 
    int PAINTKIT_VANILLA 9001;

    /*
     * Called before a named item is created for a player
     *
     * @param client            The client index of the player receiving the named item
     * @param classname            The classname of the item to be created
     * @noreturn
    */
    forward void OnGiveNamedItemEx(int client, const char[] classname);

    native GiveNamedItem_SetClassname(const char[] classname);

    native GiveNamedItem_GetDefinitionIndex();
    native GiveNamedItem_SetDefinitionIndex(int value);

    native bool GiveNamedItem_GetInUse();

    native GiveNamedItem_GetPaintkit();
    native GiveNamedItem_SetPaintkit(int value);

    native GiveNamedItem_GetSeed();
    native GiveNamedItem_SetSeed(int value);

    native GiveNamedItem_GetWear();
    native GiveNamedItem_SetWear(float value);

    native GiveNamedItem_GetKills();
    native GiveNamedItem_SetKills(int value);

    native GiveNamedItem_GetEntityQuality();
    native GiveNamedItem_SetEntityQuality(int value);

    native bool GiveNamedItem_GetTeamSwitch();
    native GiveNamedItem_SetTeamSwitch(bool value);

    native GiveNamedItem_GetAccountID();
    native GiveNamedItem_SetAccountID(int value);

    native GiveNamedItem_SetNameTag(char[] nametag);

    native int GiveNamedItem_GetItemDefinitionByClassname(const char[] classname);
    native bool GiveNamedItem_GetClassnameByItemDefinition(int itemdefinitionchar[] bufferint length);
    native bool GiveNamedItem_IsItemDefinitionKnife(int itemdefinition);
    native bool GiveNamedItem_IsClassnameKnife(const char[] classname);

    native GiveNamedItem_GiveKnife(clientint itemdefinition);

    native GetNamedItem_GetWeaponTeamByItemDefinition(int itemdefinition);

    #if defined _givenameditem_server
     #endinput
    #endif

    methodmap GiveNamedItem_ClientHook
    {
        public 
    GiveNamedItem_ClientHook()
        {
            return 
    view_as<GiveNamedItem_ClientHook>(1);
        }
        
        
    property bool InUse
        
    {
            public 
    get() { return GiveNamedItem_GetInUse(); }
        }
        
        
    property int ItemDefinition
        
    {
            public 
    get() { return GiveNamedItem_GetDefinitionIndex(); }
            public 
    set(int value) { GiveNamedItem_SetDefinitionIndex(value); }
        }
        
        
    property int Paintkit
        
    {
            public 
    get() { return GiveNamedItem_GetPaintkit(); }
            public 
    set(int value) { GiveNamedItem_SetPaintkit(value); }
        }
        
        
    property int Seed
        
    {
            public 
    get() { return GiveNamedItem_GetSeed(); }
            public 
    set(int value) { GiveNamedItem_SetSeed(value); }
        }
        
        
    property float Wear
        
    {
            public 
    get() { return view_as<float>(GiveNamedItem_GetWear()); }
            public 
    set(float value) { GiveNamedItem_SetWear(value); }
        }
        
        
    property int Kills
        
    {
            public 
    get() { return GiveNamedItem_GetKills(); }
            public 
    set(int value) { GiveNamedItem_SetKills(value); }
        }
        
        
    property int EntityQuality
        
    {
            public 
    get() { return GiveNamedItem_GetEntityQuality(); }
            public 
    set(int value) { GiveNamedItem_SetEntityQuality(value); }
        }
        
        
    property bool TeamSwitch
        
    {
            public 
    get() { return GiveNamedItem_GetTeamSwitch(); }
            public 
    set(bool value) { GiveNamedItem_SetTeamSwitch(value); }
        }
        
        
    property int AccountID
        
    {
            public 
    get() { return GiveNamedItem_GetAccountID(); }
            public 
    set(int value) { GiveNamedItem_SetAccountID(value); }
        }
        
        public 
    bool SetClassname(const char[] classname)
        {
            
    GiveNamedItem_SetClassname(classname);
        }
        
        public 
    int GetItemDefinitionByClassname(const char[] classname)
        {
            return 
    GiveNamedItem_GetItemDefinitionByClassname(classname);
        }
        
        public 
    bool GetClassnameByItemDefinition(int itemdefinitionchar[] bufferint length)
        {
            return 
    GiveNamedItem_GetClassnameByItemDefinition(itemdefinitionbufferlength);
        }
        
        public 
    bool IsItemDefinitionKnife(int itemdefinition)
        {
            return 
    GiveNamedItem_IsItemDefinitionKnife(itemdefinition);
        }
        
        public 
    bool IsClassnameKnife(const char[] classname)
        {
            return 
    GiveNamedItem_IsClassnameKnife(classname);
        }
        
        public 
    int GetWeaponTeamByItemDefinition(int itemdefinition)
        {
            return 
    GetNamedItem_GetWeaponTeamByItemDefinition(itemdefinition);
        }
    }

    GiveNamedItem_ClientHook GiveNamedItemEx view_as<GiveNamedItem_ClientHook>(1); 

    Download:

    Main repository
    Direct download
    Code changes
    __________________
    Veteran SourceMod Coder -> Activity channel
    Taking paid and free jobs.
    Contact: Steam, Telegram or discord ( Franc1sco#7876 ).

    You like my work? +Rep in my steam profile comments or donate.


    Last edited by Franc1sco; 11-18-2019 at 20:39.
    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 11-09-2019 , 11:56   Re: [CS:GO] GiveNamedItem tool (for valve items plugins)
    Reply With Quote #2

    -Fix knives for latest ptah and improvements on givenameditem plugin.
    __________________
    Veteran SourceMod Coder -> Activity channel
    Taking paid and free jobs.
    Contact: Steam, Telegram or discord ( Franc1sco#7876 ).

    You like my work? +Rep in my steam profile comments or donate.

    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Franc1sco
    Veteran Member
    Join Date: Oct 2010
    Location: Spain (Madrid)
    Old 11-18-2019 , 20:24   Re: [CS:GO] GiveNamedItem tool (for valve items plugins)
    Reply With Quote #3

    -Added support for the new operation knives.
    __________________
    Veteran SourceMod Coder -> Activity channel
    Taking paid and free jobs.
    Contact: Steam, Telegram or discord ( Franc1sco#7876 ).

    You like my work? +Rep in my steam profile comments or donate.

    Franc1sco is offline
    Send a message via MSN to Franc1sco
    Reply


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


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