Raised This Month: $ Target: $400
 0% 

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 , 15:12   Re: [TF2] Changing a weapon with TF2 items.
Reply With Quote #1

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
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 #2

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
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 21:14.


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