AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   TF2Items (https://forums.alliedmods.net/forumdisplay.php?f=146)
-   -   Changing a weapon with TF2 items. (https://forums.alliedmods.net/showthread.php?t=188320)

ReFlexPoison 06-25-2012 04:23

Changing a weapon with TF2 items.
 
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. :oops:

Thanks in advance.

Leonardo 06-25-2012 06:40

Re: [TF2] Changing a weapon with TF2 items.
 
um
wait
deathrun...
with weapon...
DA HELL?!

ReFlexPoison 06-25-2012 12:27

Re: [TF2] Changing a weapon with TF2 items.
 
Quote:

Originally Posted by Leonardo (Post 1735679)
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.

Leonardo 06-25-2012 13:08

Re: [TF2] Changing a weapon with TF2 items.
 
remove chargin targe - and demo can't charge.
simple?
tf2_stocks has TF2_RemoveWeaponSlot();
not a big deal

ReFlexPoison 06-25-2012 15:12

Re: [TF2] Changing a weapon with TF2 items.
 
Quote:

Originally Posted by Leonardo (Post 1735881)
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.

Leonardo 06-25-2012 16:08

Re: [TF2] Changing a weapon with TF2 items.
 
did you test that?

ReFlexPoison 06-25-2012 16:40

Re: [TF2] Changing a weapon with TF2 items.
 
Quote:

Originally Posted by Leonardo (Post 1735996)
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

Thrawn2 06-25-2012 16:59

Re: [TF2] Changing a weapon with TF2 items.
 
take a look at the modules from tNoUnlocksPls.

Powerlord 06-25-2012 17:38

Re: [TF2] Changing a weapon with TF2 items.
 
Quote:

Originally Posted by ReFlexPoison (Post 1735965)
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.

Leonardo 06-26-2012 00:12

Re: [TF2] Changing a weapon with TF2 items.
 
PHP Code:

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


http://wiki.teamfortress.com/w/image...y_Engineer.png


All times are GMT -4. The time now is 10:02.

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