Raised This Month: $ Target: $400
 0% 

TF2 Giving weapons to another class


Post New Thread Reply   
 
Thread Tools Display Modes
Sexual Harassment Panda
Veteran Member
Join Date: Dec 2008
Location: San Diego, CA
Old 08-03-2009 , 23:25   Re: TF2 Giving weapons to another class
Reply With Quote #121

just checking, are people still using the offsets posted on last page? it's really annoying for me as on my test server this plugin works fine, but on my main server it does not. I just completely reinstalled it too.
__________________
Sexual Harassment Panda is offline
cybersquare420
Veteran Member
Join Date: Nov 2008
Old 08-04-2009 , 10:01   Re: TF2 Giving weapons to another class
Reply With Quote #122

still working fine for me...
__________________
cybersquare420 is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 08-08-2009 , 07:45   Re: TF2 Giving weapons to another class
Reply With Quote #123

Quote:
Originally Posted by Sexual Harassment Panda View Post
just checking, are people still using the offsets posted on last page? it's really annoying for me as on my test server this plugin works fine, but on my main server it does not. I just completely reinstalled it too.
http://forums.alliedmods.net/showpos...&postcount=117

These still work for me
__________________
MrSaturn is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 08-14-2009 , 14:44   Re: TF2 Giving weapons to another class
Reply With Quote #124

With the latest update, my favorite toy is now broken

I'm not sure if its an offsets problem. Usually, if it were the offsets then the server would just flat out crash.

Now whenever you try to give someone a weapon it spawns floating at their feet and their weapon slot becomes disabled. The weapon stays there throughout the round and doesnt disappear.

I wish I knew how to fix it :'(

Damizean gave me a list of offsets updated from the new valve update.

http://wiki.alliedmods.net/CTFPlayer...am_Fortress_2)

but the givenameditem offset is still the same (see last one)

so I dont think its an offsets problem, but I'm not sure.

EDIT : Was there always a 'CanUse' offset?
234 CBasePlayer::Weapon_CanUse(CBaseCombatWeapon *)
__________________

Last edited by MrSaturn; 08-15-2009 at 01:48.
MrSaturn is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 08-14-2009 , 21:47   Re: TF2 Giving weapons to another class
Reply With Quote #125

I think I'm going to quit running a server if the sourcemod plugins dont get fixed all the way. Its just not worth the hassle anymore.

And here I thought the update was going to be such a good thing...

I love Valve... but... I also hate them.
__________________
MrSaturn is offline
cybersquare420
Veteran Member
Join Date: Nov 2008
Old 08-15-2009 , 12:36   Re: TF2 Giving weapons to another class
Reply With Quote #126

there are two offsets listed for givenamed item... 426, and 357... which is it?...

anyone?

edit: it appears that neither of them are correct... or am i reading this wrong? i tried both values... but i was looking at the old settings and they are not 1 apart as stated in that wiki, so i am not sure what to think... :S
__________________

Last edited by cybersquare420; 08-15-2009 at 12:51.
cybersquare420 is offline
FireMage1315
New Member
Join Date: Aug 2009
Old 08-15-2009 , 17:04   Re: TF2 Giving weapons to another class
Reply With Quote #127

Here's something that worked for me. But it seems to only work with the plugin on the first page.
It only worked in the console.

PHP Code:
"Games" 

    
"tf" 
    

        
"Offsets" 
        

            
"GiveNamedItem" 
            

                
"windows"    "357" 
                "linux"        "426" 
            

            
"WeaponEquip" 
            

                
"windows"    "235" 
                "linux"        "235" 
            

            
"ForceStalemate" 
            

                
"windows"    "145" 
                "linux"        "146" 
            

        } 
    } 

FireMage1315 is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 08-15-2009 , 19:40   Re: TF2 Giving weapons to another class
Reply With Quote #128

Quote:
Originally Posted by FireMage1315 View Post
Here's something that worked for me. But it seems to only work with the plugin on the first page.
It only worked in the console.

PHP Code:
"Games" 

    
"tf" 
    

        
"Offsets" 
        

            
"GiveNamedItem" 
            

                
"windows"    "357" 
                "linux"        "426" 
            

            
"WeaponEquip" 
            

                
"windows"    "235" 
                "linux"        "235" 
            

            
"ForceStalemate" 
            

                
"windows"    "145" 
                "linux"        "146" 
            

        } 
    } 

+karma!

I was really getting sorta depressed for a moment there.

Weird thing though, the scout is able to keep his weapons as long as he doesnt change classes.

trying something like

PHP Code:
public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
client && IsClientInGame(client) && IsPlayerAlive(client))
    {
        new class = 
GetEventInt(event"class");
        if (class == 
1)
            {
            
GetClientWeapon(sizeof(weapon));
            if (
StrEqual(weapon"tf_weapon_flamethrower")
                || 
StrEqual(weapon"tf_weapon_grenadelauncher")
                || 
StrEqual(weapon"tf_weapon_pipebomblauncher")
                || 
StrEqual(weapon"tf_weapon_rocketlauncher")
                || 
StrEqual(weapon"tf_weapon_medigun")
                || 
StrEqual(weapon"tf_weapon_minigun")
                || 
StrEqual(weapon"tf_weapon_sniperrifle")
                || 
StrEqual(weapon"tf_weapon_smg")
                || 
StrEqual(weapon"tf_weapon_syringegun_medic")
                || 
StrEqual(weapon"tf_weapon_fireaxe")
                || 
StrEqual(weapon"tf_weapon_fists")
                || 
StrEqual(weapon"tf_weapon_club")
                || 
StrEqual(weapon"tf_weapon_wrench")
                || 
StrEqual(weapon"tf_weapon_bonesaw")
                || 
StrEqual(weapon"tf_weapon_shovel")
                || 
StrEqual(weapon"tf_weapon_bottle");
                {
                    new 
target GetClientOfUserId(iUserId);
                    
TF2_SetPlayerClass(targetTFClass_Pyro);
                    
TF2_RespawnPlayer(target);
                    
TF2_SetPlayerClass(targetTFClass_Scout);
                    
TF2_RespawnPlayer(target);
                    return 
Plugin_Handled;
                }

                   }
        }

But mixed results....
Attached Files
File Type: sp Get Plugin or Get Source (givenameditem.sp - 316 views - 2.9 KB)
File Type: txt givenameditem.games.txt (500 Bytes, 128 views)
File Type: txt tf2weapondata.txt (2.5 KB, 127 views)
__________________

Last edited by MrSaturn; 08-16-2009 at 02:01.
MrSaturn is offline
Quimbo
Member
Join Date: May 2008
Old 08-16-2009 , 22:53   Re: TF2 Giving weapons to another class
Reply With Quote #129

The new offset for givenameditem you posted is actually the CBasePlayer::GiveNamedItem offset and not the CTFPlayer::GiveNamedItem offset it was before the patch (both are in the vtable for CTFPlayer at a different offset).

If you call CTFPlayer::GiveNamedItem you get a crash.

Notice that you get console output about an unititialized item now when calling CBasePlayer::GiveNamedItem.
I believe this is because the item is not set up correctly to be shown in the new spectator HUD which shows the weapon of the spectated target.
Quimbo is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 08-17-2009 , 02:00   Re: TF2 Giving weapons to another class
Reply With Quote #130

The CBasePlayer version crashes TF2, but the CTFPlayer version should still work.

Try the following offsets:
356 windows
357 linux
bl4nk 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 07:17.


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