Raised This Month: $ Target: $400
 0% 

[TF2] Giving Items & Engineer Buildings


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpideyFusion
SourceMod Donor
Join Date: Oct 2010
Old 02-26-2013 , 15:22   [TF2] Giving Items & Engineer Buildings
Reply With Quote #1

I've ran into an issue where if I change the Engineer's melee weapon (ex. Gunslinger -> Wrench), the player's buildings get destroyed. I tried changing the m_hBuilder properties of buildings and I still have the issue. This issue isn't related to TF2Items or the Give Weapon plugin, hence why I'm posting here instead. Anyone have any pointers?

PHP Code:
public TF2Items_OnGiveNamedItem_Post(clientString:classname[], iItemDefinitionIndexitemLevelitemQualityentityIndex)
{
    if (!
IsItemStock(iItemDefinitionIndex))
        
CreateTimer(0.1Timer_RemoveItementityIndex);

    if (
g_clientSetupQueue[client] == INVALID_HANDLE)
        
g_clientSetupQueue[client] = CreateTimer(0.1Timer_SetupItemsclient);

PHP Code:
public Action:Timer_RemoveItem(Handle:timerany:entityIndex)
{
    if (
IsValidEntity(entityIndex))
        
AcceptEntityInput(entityIndex"kill");

PHP Code:
public Action:Timer_SetupItems(Handle:timerany:client)
{
    switch (
TF2_GetPlayerClass(client))
    {
        case 
TFClass_Scout:
        {
            
TF2Items_GiveWeapon(client13);
            
TF2Items_GiveWeapon(client23);
            
TF2Items_GiveWeapon(client0);
        }
        case 
TFClass_Soldier:
        {
            
TF2Items_GiveWeapon(client18);
            
TF2Items_GiveWeapon(client10);
            
TF2Items_GiveWeapon(client6);
        }
        case 
TFClass_Pyro:
        {
            
TF2Items_GiveWeapon(client21);
            
TF2Items_GiveWeapon(client12);
            
TF2Items_GiveWeapon(client2);
        }
        case 
TFClass_DemoMan:
        {
            
TF2Items_GiveWeapon(client19);
            
TF2Items_GiveWeapon(client20);
            
TF2Items_GiveWeapon(client1);
        }
        case 
TFClass_Heavy:
        {
            
TF2Items_GiveWeapon(client15);
            
TF2Items_GiveWeapon(client11);
            
TF2Items_GiveWeapon(client5);
        }
        case 
TFClass_Engineer:
        {
            
TF2Items_GiveWeapon(client9);
            
TF2Items_GiveWeapon(client22);
            
TF2Items_GiveWeapon(client7);
            
TF2Items_GiveWeapon(client25);
            
TF2Items_GiveWeapon(client26);
            
TF2Items_GiveWeapon(client28);
        }
        case 
TFClass_Medic:
        {
            
TF2Items_GiveWeapon(client17);
            
TF2Items_GiveWeapon(client29);
            
TF2Items_GiveWeapon(client8);
        }
        case 
TFClass_Sniper:
        {
            
TF2Items_GiveWeapon(client14);
            
TF2Items_GiveWeapon(client16);
            
TF2Items_GiveWeapon(client3);
        }
        case 
TFClass_Spy:
        {
            
TF2Items_GiveWeapon(client24);
            
TF2Items_GiveWeapon(client735);
            
TF2Items_GiveWeapon(client4);
            
TF2Items_GiveWeapon(client27);
            
TF2Items_GiveWeapon(client30);
        }
    }

    
g_clientSetupQueue[client] = INVALID_HANDLE;

SpideyFusion is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-26-2013 , 16:27   Re: [TF2] Giving Items & Engineer Buildings
Reply With Quote #2

Quote:
Originally Posted by SpideyFusion View Post
I've ran into an issue where if I change the Engineer's melee weapon (ex. Gunslinger -> Wrench), the player's buildings get destroyed.
This was Valve's fix for the level 3 mini-sentry glitch. Unfortunately, they didn't limit it to switching to and from the Gunslinger (and arguably the Eureka Effect)... any time you switch wrenches, all the player's buildings get destroyed.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-26-2013 at 16:29.
Powerlord is offline
SpideyFusion
SourceMod Donor
Join Date: Oct 2010
Old 02-26-2013 , 16:33   Re: [TF2] Giving Items & Engineer Buildings
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
This was Valve's fix for the level 3 mini-sentry glitch. Unfortunately, they didn't limit it to switching to and from the Gunslinger (and arguably the Eureka Effect)... any time you switch wrenches, all the player's buildings get destroyed.
Any way I can get around this and preserve buildings? I'm working on a TF2 vanilla-like plugin.
SpideyFusion 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 17:20.


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