Raised This Month: $ Target: $400
 0% 

Getting my plugin to respect tf2items.weapons.txt


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-03-2013 , 23:39   Getting my plugin to respect tf2items.weapons.txt
Reply With Quote #1

PHP Code:
            new Handle:item TF2Items_CreateItem(OVERRIDE_ITEM_LEVEL OVERRIDE_ITEM_QUALITY FORCE_GENERATION);
            
TF2Items_SetClassname(item"tf_weapon_rocketlauncher");
            
TF2Items_SetItemIndex(item205);
            
TF2Items_SetQuality(item6);
            
TF2Items_SetLevel(item1);
            
//TF2Items_SetNumAttributes(item, 0);
            
slotid[0] = TF2Items_GiveNamedItem(clientitem);
            
EquipPlayerWeapon(clientslotid[0]);
            
CloseHandle(item); 
I get the feeling there is some really simple way to do this, but I am at a loss.

I can get it to work based on any attribs I put, but it won't use the attributes defined in my tf2items.weapons.txt file.
CoolJosh3k is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-04-2013 , 00:02   Re: Getting my plugin to respect tf2items.weapons.txt
Reply With Quote #2

You can't, you have to be working inside the forward to respect other plugins.
__________________
asherkin is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-04-2013 , 00:17   Re: Getting my plugin to respect tf2items.weapons.txt
Reply With Quote #3

Inside the forward... I guess I cannot do this from inside another plugin then, no matter what?

My other plan was to read the key values directly from the txt file. To do this though requires a lot more knowledge about key values than I have right now. I would have to pull the right attribs from the right section and add them into each of my 33 handles. Gah
CoolJosh3k is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 06-04-2013 , 02:58   Re: Getting my plugin to respect tf2items.weapons.txt
Reply With Quote #4

i think you could probably make a forward in the plugin that provides tf2items.weapons.txt and use its forward instead
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-05-2013 , 01:26   Re: Getting my plugin to respect tf2items.weapons.txt
Reply With Quote #5

Quote:
Originally Posted by Zephyrus View Post
i think you could probably make a forward in the plugin that provides tf2items.weapons.txt and use its forward instead
Yes, but then any updates to tf2items would kill it.
CoolJosh3k is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 06-05-2013 , 01:31   Re: Getting my plugin to respect tf2items.weapons.txt
Reply With Quote #6

There is already a forward, TF2Items_OnGiveNamedItem.
__________________
asherkin is offline
CoolJosh3k
AlliedModders Donor
Join Date: Mar 2010
Old 06-05-2013 , 04:05   Re: Getting my plugin to respect tf2items.weapons.txt
Reply With Quote #7

But, isn't the issue that a plugin cannot use the TF2Items_OnGiveNamedItem to force a weapon onto a player, with respect to what is set in tf2items.weapons.txt ?

I am working on code to read directly from the tf2items.weapons.txt and store the data into 33 different handles. I do hope there is some easier/better way.
CoolJosh3k is offline
Reply



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:59.


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