Raised This Month: $32 Target: $400
 8% 

Changing a weapon with TF2 items.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 06-25-2012 , 04:23   Changing a weapon with TF2 items.
Reply With Quote #1

Now I am very unfamiliar with TF2Items and I've been programming a new deathrun beta for my gaming community, is it possible to exchange weapons for others. I do apologize if this question has been raised before, but atm, I'm throwing out a couple of posts before I get some sleep.

Thanks in advance.

Last edited by ReFlexPoison; 06-26-2012 at 17:45.
ReFlexPoison is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 06-25-2012 , 06:40   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #2

um
wait
deathrun...
with weapon...
DA HELL?!

Last edited by Leonardo; 06-25-2012 at 09:41.
Leonardo is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 06-25-2012 , 12:27   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #3

Quote:
Originally Posted by Leonardo View Post
um
wait
deathrun...
with weapon...
DA HELL?!
I can go into great details in why we use melee weapons, but, atm, it is all stock, meaning hats are disabled. I'm mainly asking so I can disable certain weapons and return it to something else so, for example, demomans can't charge.
ReFlexPoison is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 06-25-2012 , 13:08   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #4

remove chargin targe - and demo can't charge.
simple?
tf2_stocks has TF2_RemoveWeaponSlot();
not a big deal
Leonardo is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 06-25-2012 , 15:12   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #5

Quote:
Originally Posted by Leonardo View Post
remove chargin targe - and demo can't charge.
simple?
tf2_stocks has TF2_RemoveWeaponSlot();
not a big deal
doesn't work as shields aren't actual weapon slots.
ReFlexPoison is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 06-25-2012 , 16:08   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #6

did you test that?
Leonardo is offline
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: ☠☠☠
Old 06-25-2012 , 16:40   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #7

Quote:
Originally Posted by Leonardo View Post
did you test that?
yes? i don't think i'm missing anything when i do it, but yes, i removed all slots except melee
ReFlexPoison is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 06-25-2012 , 16:59   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #8

take a look at the modules from tNoUnlocksPls.
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-25-2012 , 17:38   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #9

Quote:
Originally Posted by ReFlexPoison View Post
doesn't work as shields aren't actual weapon slots.
That's something that annoyed me when I was testing GetPlayerWeaponSlot with TF2 Item indexes. tf_wearable and tf_wearable_demoshield don't appear as standard items, and you instead have to block them via TF2Items_OnGiveNamedItem and returning Plugin_Handled to prevent it from being given to them.

Something like this:

PHP Code:
public Action:TF2Items_OnGiveNamedItem(clientString:classname[], iItemDefinitionIndex, &Handle:hItem)
{
    if (
StrEqual(classname"tf_wearable_demoshield"))
    {
        return 
Plugin_Handled;
    }

This doesn't use item indexes because Valve could add more demoshields than the two that already exist.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-25-2012 at 17:43.
Powerlord is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 06-26-2012 , 00:12   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #10

PHP Code:
public Action:TF2Items_OnGiveNamedItemiClientString:strClassname[], iItemDefinitionIndex, &Handle:hItem )
{
    if( 
StrContainsstrClassname"tf_wearable"false ) == )
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

Leonardo 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 10:21.


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