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

[TF2] Equipment manager 1.1.8 (05/22/10)


Post New Thread Reply   
 
Thread Tools Display Modes
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 07-27-2009 , 22:36   Re: [TF2] Wearables for everyone!
Reply With Quote #31

The Scout one doesn't work because in the data file you called it Battler's Helmet. Changing it to Batter's fixes it.
noodleboy347 is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 07-28-2009 , 01:58   Re: [TF2] Wearables for everyone!
Reply With Quote #32

Here's some example code to make hats stick after touching an ammo cabnit. Hope it helps:

Code:
new Handle:g_hDistance = INVALID_HANDLE;

public OnPluginStart()
{
     g_hDistance = CreateConVar("sm_jumble_distance", "128.0", "<128.0> Player distance to ammo cabnit to regenerate.");
     HookEntityOutput("prop_dynamic", "OnAnimationBegun", EntityOutput_OnAnimationBegun);
}

public EntityOutput_OnAnimationBegun(const String:output[], caller, activator, Float:delay)
{
    if(IsValidEntity(caller))
    {
        new String:strModelName[128];
        GetEntPropString(caller, Prop_Data, "m_ModelName", strModelName, sizeof(strModelName));
        if (StrEqual(strModelName, "models/props_gameplay/resupply_locker.mdl"))
        {
            new Float:flPos[3];
            GetEntPropVector(caller, Prop_Send, "m_vecOrigin", flPos);

            for (new i=1;i<=MaxClients;i++)
            {
                if(IsClientInGame(i) && IsPlayerAlive(i))
                {
                    new Float:flOrigin[3];
                    GetEntPropVector(i, Prop_Send, "m_vecOrigin", flOrigin);
                    
                    // Player was close enough to ammo cabnit, so re-equip hat
                    if(GetVectorDistance(flPos, flOrigin) <= GetConVarFloat(g_hDistance))
                    {
                        // Code to re-equip hat here. Entity is already destroyed.
                    }
                }
            }
        }        
    }
}

Last edited by pheadxdll; 07-28-2009 at 02:00.
pheadxdll is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 07-28-2009 , 03:01   Re: [TF2] Wearables for everyone!
Reply With Quote #33

Quote:
Originally Posted by Damizean View Post
Well, I've integrated a small dependencies system to manage the download of the wearable items. Let's say you have your custom model, located at:
Code:
/models/custom/hats/hat.mdl
After reading the model location from the list, the plugin will automatically try to find if a dependencies list file is available for this model, being this dependencies file being named the same as the model, but adding .dep at the end
Code:
/models/custom/hats/hat.mdl.dep
The dependencies file is just a bunch of lines with the files required for that model to correctly work, example extracted from one of my custom hats:
Code:
materials/models/rss-custom/hats/samus/samus-blue.vtf
materials/models/rss-custom/hats/samus/samus.vtf
materials/models/rss-custom/hats/samus/samus-blue.vmt
materials/models/rss-custom/hats/samus/samus.vmt
models/rss-custom/hats/samus/samus.mdl
models/rss-custom/hats/samus/samus.dx80.vtx
models/rss-custom/hats/samus/samus.dx90.vtx
models/rss-custom/hats/samus/samus.sw.vtx
models/rss-custom/hats/samus/samus.vvd
models/rss-custom/hats/samus/samus.phy
Depending on the extension of each file listed, it'll automatically determine the type and preload it correctly. I'm going to attach the Samus helmet so you can see how it's set up.

Do you mean equip automatically with a certain hat the people with the flags? It's doable, I'll make sure to add that for next version.
Cant seem to get it to work at all. All I get are error models.

I've uploaded the files both onto my gameserver and onto my webhost fast download server.
I've edited the Translation file (tf2_wearables.items) and TF2_Wearables (in the data folder) to add samus helm.

I've checked my clientside folder and they seem to be downloading fine. I dont know what could be going wrong.
__________________
MrSaturn is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 07-28-2009 , 03:12   Re: [TF2] Wearables for everyone!
Reply With Quote #34

Quote:
Originally Posted by MrSaturn View Post
Cant seem to get it to work at all. All I get are error models.

I've uploaded the files both onto my gameserver and onto my webhost fast download server.
I've edited the Translation file (tf2_wearables.items) and TF2_Wearables (in the data folder) to add samus helm.

I've checked my clientside folder and they seem to be downloading fine. I dont know what could be going wrong.
Try restarting your server, and maybe adding the models to the whitelist.

@OP, can you also make it so with admin only the message it has when you join the server is for admins only? And can you also make a trigger for it, like suggested above (!hats)
noodleboy347 is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 07-28-2009 , 03:15   Re: [TF2] Wearables for everyone!
Reply With Quote #35

Working now somehow magically. Thanks for the help
__________________

Last edited by MrSaturn; 07-28-2009 at 03:31.
MrSaturn is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 07-28-2009 , 04:15   Re: [TF2] Wearables for everyone!
Reply With Quote #36

It would be pretty wicked if you incorporated a command like sm_wear, so you could force wearables on someone without having to tell them about the menu and etc.

This could also work with other plugins too.
__________________
MrSaturn is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 07-28-2009 , 04:21   Re: [TF2] Wearables for everyone!
Reply With Quote #37

Quote:
Originally Posted by MrSaturn View Post
It would be pretty wicked if you incorporated a command like sm_wear, so you could force wearables on someone without having to tell them about the menu and etc.

This could also work with other plugins too.
That's just what I was thinking.

Please?
noodleboy347 is offline
Neo Cool Dude
Member
Join Date: Apr 2008
Old 07-28-2009 , 10:02   Re: [TF2] Wearables for everyone!
Reply With Quote #38

Quote:
Originally Posted by noodleboy347 View Post
That's just what I was thinking.

Please?
Pretty pretty please, with a gum drop on top?
Neo Cool Dude is offline
Damizean
SourceMod Donor
Join Date: Mar 2009
Old 07-28-2009 , 12:07   Re: [TF2] Wearables for everyone!
Reply With Quote #39

xD I will, but wait before I can get things in order, I've been rewriting quite some stuff, I've made a more complex way to setup the wearables, allowing you to select wich classes can use them, if only admins can or wich are the forceable defaults for common users or admins (for the armband thing).

Also, I'm increasing the number of wearable items at once to 3 so you can, for example, wear a helmet and an armor at the same time. I still need to check if this works properly though.

Example of the new style of setup:
PHP Code:
/*****************************************************************************
                           PROPERTIES TABLE
******************************************************************************

Flags:
+---------------------+------------------------------------------------------+
| FLAGS               | DESCRIPTION                                          |
+---------------------+------------------------------------------------------+
| DEFAULT             | Sets the wearable as default for common users        |
| ADMIN_DEFAULT       | Sets the wearable as the admin default               |
| ADMIN_ONLY          | This hat is wearable only by admins                  |
| USE_TRANSLATION     | Use translation tables for the name of this item     |
+---------------------+------------------------------------------------------+

Classes:
+---------------------+---------------------+---------------------+
| CLASS               | CLASS               | CLASS               |
+---------------------+---------------------+---------------------+
| SCOUT               | SNIPER              | SOLDIER             |
| DEMOMAN             | MEDIC               | HEAVY               |
| PYRO                | SPY                 | ENGINEER            |
+---------------------+---------------------+---------------------+
| ALL                 |
+---------------------+

Slots:
+---------------------+
| SLOTS               |
+---------------------+
| 0                   |
| 1                   |
| 2                   |
+---------------------+
                                                                              
*****************************************************************************/

"Hats"
{
    
"Afro"
    
{
        
"model"        "models/player/items/demo/demo_afro.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "DEMOMAN"
        "slot"        "0"
    
}
    
    
"MiningHat"
    
{
        
"model"        "models/player/items/engineer/mining_hat.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "ENGINEER"
        "slot"        "0"
    
}
    
"SpyHat"
    
{
        
"model"        "models/player/items/spy/spy_hat.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "SPY"
        "slot"        "0"
    
}
    
"FootballHelmet"
    
{
        
"model"        "models/player/items/heavy/football_helmet.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "HEAVY"
        "slot"        "0"
    
}
    
"MedicHelmet"
    
{
        
"model"        "models/player/items/medic/medic_helmet.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "HEAVY"
        "slot"        "0"
    
}
    
"PyroHat"
    
{
        
"model"        "models/player/items/pyro/pyro_hat.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "PYRO"        
        "slot"        "0"
    
}
    
"BatterHelmet"
    
{
        
"model"        "models/player/items/scout/batter_helmet.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "HEAVY"
        "slot"        "0"
    
}
    
"ToothHat"
    
{
        
"model"        "models/player/items/sniper/tooth_hat.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "SNIPER"
        "slot"        "0"
    
}
    
"SoldierHat"
    
{
        
"model"        "models/player/items/soldier/soldier_hat.mdl"
        "flags"        "DEFAULT, USE_TRANSLATION"
        "classes"    "SOLDIER"
        "slot"        "0"
    
}

__________________
Dat annoying guy

Last edited by Damizean; 07-28-2009 at 12:09.
Damizean is offline
Send a message via AIM to Damizean Send a message via MSN to Damizean
Sexual Harassment Panda
Veteran Member
Join Date: Dec 2008
Location: San Diego, CA
Old 07-28-2009 , 14:38   Re: [TF2] Wearables for everyone!
Reply With Quote #40

I am very excited, looks like you've been busy.
__________________
Sexual Harassment Panda 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:04.


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