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

[CS:GO] Rifle in Pistol slot?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kinsi
Senior Member
Join Date: Apr 2013
Old 01-09-2017 , 14:51   [CS:GO] Rifle in Pistol slot?
Reply With Quote #1

I am currently attempting to... well.. somehow get something into the pistol slot that doesnt belong there, as an example an AK.

What i wanted to to at first is just listen for the user to press slot2 and then do stuff, unfortunately that is not possible unless there is actually a pistol equipped.

What i have tried:

- Setting the classname of the AK to the one of a pistol, still in rifle slot
- Setting m_iPrimaryAmmoType, no change
- Setting m_iItemDefinitionIndex (Even its "forbidden" by valve, just as a test), AK now has the deagle model, is still in the rifle slot though

I've also tried to change some netprops which seemed like they could result in what i am looking for to the ones of a spawned AK with no success either.

Is this somehow possible to achieve? Is the destiation really hardcoded by the baseclass? Or is there something i've overlooked.

Alternatively, is it somehow possible to hook the press of slot1-10 without an item actually being in that slot?

Thanks!

TL;DR trying to modify "destination" slot of a weapon to e.g. put an AK into the Pistol slot. Alternatively looking to hook slot1-10 without an item being in that slot.

Last edited by Kinsi; 01-09-2017 at 14:52.
Kinsi is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-09-2017 , 16:04   Re: [CS:GO] Rifle in Pistol slot?
Reply With Quote #2

There are threads talking about how to read all the grenades stored in one slot.

I figure if you avoid EquipPlayerItem and store the weapon index manually you would get your result.

Im really not sure...
__________________
Neuro Toxin is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-09-2017 , 16:06   Re: [CS:GO] Rifle in Pistol slot?
Reply With Quote #3

The closest thing I could think of would to strip the primary and replace it everytime the player switches to the secondary weapon. The weapon slots are hard-coded into the client's files also.
Mitchell is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 01-09-2017 , 16:16   Re: [CS:GO] Rifle in Pistol slot?
Reply With Quote #4

Quote:
Originally Posted by Neuro Toxin View Post
I figure if you avoid EquipPlayerItem and store the weapon index manually you would get your result.
I have tried to simply "inject" the spawned weapon into m_hMyWeapons, which worked, but the offset in the data table does not matter. You can place an ak anywhere in the table and it will land in the ak slot, same goes for any other weapon type.

Quote:
Originally Posted by Mitchell View Post
The closest thing I could think of would to strip the primary and replace it everytime the player switches to the secondary weapon. The weapon slots are hard-coded into the client's files also.
Thats what i wanted to do at first, unfortunately like i said pressing 1-9 does not get transmitted to the server when you dont have a weapon in the corresponding slot. I guess i will have to find some workaround / do stuff differently than i planned it.

Last edited by Kinsi; 01-09-2017 at 16:46.
Kinsi is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-09-2017 , 18:28   Re: [CS:GO] Rifle in Pistol slot?
Reply With Quote #5

Quote:
Originally Posted by Kinsi View Post
Thats what i wanted to do at first, unfortunately like i said pressing 1-9 does not get transmitted to the server when you dont have a weapon in the corresponding slot. I guess i will have to find some workaround / do stuff differently than i planned it.
I didn't mention hooking the presses of 1-9.
Mitchell is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 01-09-2017 , 18:46   Re: [CS:GO] Rifle in Pistol slot?
Reply With Quote #6

Quote:
Originally Posted by Mitchell View Post
I didn't mention hooking the presses of 1-9.
What i meant to say is that i wanted to set the players weapon dynamically, and giving him the ability to chose his weapon by pressing 1 trough 9. Sorry for being unclear.
Kinsi 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 03:48.


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