Raised This Month: $12 Target: $400
 3% 

CS:GO GiveNamedItem Econ


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-28-2014 , 17:13   CS:GO GiveNamedItem Econ
Reply With Quote #1

This extension will create/get an EconItemView to be passed to GiveNamedItem.

So what does this help/affect. Basically the best example of this is calling GiveNamedItem on a ct player and trying to give them a ak. By default the ct will get a regular ak, this will get the EconItemView for the players ak and replace it so the given ak will have the skin/whatever the user has. This will also grab the correct gun for the loadout slot. For example if you give a terrorist a m4a1, it will check the loadout slot and give the m4a1 if that is what they have equipped or the m4a4 if they have that instead.

This was mostly to experiment with CEconItemView stuff and provide some code that might help others to create other extensions. Along with being annoyed that when I played Deathmatch and was a CT I didnt have my blue ak

The linux version is untested. Also I am not sure if stattrak stuff works but should.

Code: https://bitbucket.org/Drifter321/cs-...ditem-econ/src
Gamedata: https://bitbucket.org/Drifter321/cs-...item.games.txt

Install: drag and drop

Changelog:
  • 1.0.1
    • Add forward to allow blocking creating EconItemView.
  • 1.0.2
    • Improve method for getting player inventory offset.
Attached Files
File Type: zip csgo_gni_econ_1.0.2.zip (122.3 KB, 2034 views)

Last edited by Dr!fter; 09-12-2014 at 10:38.
Dr!fter is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 02-28-2014 , 17:28   Re: CS:GO GiveNamedItem Econ
Reply With Quote #2

So basicly if player has equipped ak-47 skin then it will equip him with ak-47 skin instead of default one?
__________________
...
Oshizu is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-28-2014 , 17:38   Re: CS:GO GiveNamedItem Econ
Reply With Quote #3

Yes
Dr!fter is offline
tigerox
AlliedModders Donor
Join Date: Oct 2008
Location: Canada
Old 03-02-2014 , 15:53   Re: CS:GO GiveNamedItem Econ
Reply With Quote #4

Would it be easier to just use GivePlayerItem. It uses whichever skin the players has set, also the correct gun is chosen for the loadout slot.
__________________

Last edited by tigerox; 03-02-2014 at 15:59.
tigerox is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 03-03-2014 , 07:42   Re: CS:GO GiveNamedItem Econ
Reply With Quote #5

Quote:
Originally Posted by tigerox View Post
Would it be easier to just use GivePlayerItem. It uses whichever skin the players has set, also the correct gun is chosen for the loadout slot.
This is only true for guns that aren't based on team or the player is on the correct team for the weapon. This fakes the team when giving a weapon that isn't used by the players team (as the example ak for ct's)

Last edited by Dr!fter; 03-03-2014 at 07:42.
Dr!fter is offline
tigerox
AlliedModders Donor
Join Date: Oct 2008
Location: Canada
Old 03-03-2014 , 09:26   Re: CS:GO GiveNamedItem Econ
Reply With Quote #6

Quote:
Originally Posted by Dr!fter View Post
This is only true for guns that aren't based on team or the player is on the correct team for the weapon. This fakes the team when giving a weapon that isn't used by the players team (as the example ak for ct's)
Cool, thanks. I will give it a try.
__________________
tigerox is offline
tigerox
AlliedModders Donor
Join Date: Oct 2008
Location: Canada
Old 03-15-2014 , 10:07   Re: CS:GO GiveNamedItem Econ
Reply With Quote #7

Quote:
Originally Posted by tigerox View Post
Cool, thanks. I will give it a try.
This has been working great on linux.

Thank you!
__________________
tigerox is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 03-03-2014 , 02:40   Re: CS:GO GiveNamedItem Econ
Reply With Quote #8

Quote:
Originally Posted by Dr!fter View Post
This was mostly to experiment with CEconItemView stuff and provide some code that might help others to create other extensions.
bl4nk is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 03-08-2014 , 09:02   Re: CS:GO GiveNamedItem Econ
Reply With Quote #9

Now you'll need to get that CEconItemView class and have csgoitems!
__________________
Peace-Maker is offline
Jargon
SourceMod Donor
Join Date: Jun 2012
Location: Sydney, Australia
Old 03-18-2014 , 16:51   Re: CS:GO GiveNamedItem Econ
Reply With Quote #10

Never mind, apparently the item servers were down so skins weren't working with or without the extension

My bad!
Jargon is offline
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 08:57.


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