AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [TF2] Trying to make the client to be forced to use weapon slot number 2. (https://forums.alliedmods.net/showthread.php?t=267190)

StormishJustice 07-25-2015 10:19

[TF2] Trying to make the client to be forced to use weapon slot number 2.
 
So i update red2robotv2 all day (or sometimes)

though i'm trying to make a command in red2robotv2 named sm_gauntlet (become a steel gauntlet only in ROBOTS!)

i removed those weapon slots (primary and secondary) but i want to make the command to force the player to use melee when becoming steel gauntlet, instead it switches to primary but stripped, pressing the melee weapon slot makes you use melee.

is there a way to force the client to use melee? help is appreciated.

Regards
- Stormish Justice

Potato Uno 07-25-2015 14:41

Re: [TF2] Trying to make the client to be forced to use weapon slot number 2.
 
Did you strip ALL the weapons first, and then give them the melee only?

Check how TF2BWR does it (too lazy to check myself).

Requiesta 07-25-2015 15:41

Re: [TF2] Trying to make the client to be forced to use weapon slot number 2.
 
First, get the melee weapon on the player:

Code:

new iWeapon = GetPlayerWeaponSlot(iClient, 2);

Then force the player to switch to it:

Code:

EquipPlayerWeapon(iClient, iWeapon);
Obviously throw in some validation checks to make sure the plugin doesn't explode.

StormishJustice 07-25-2015 16:33

Re: [TF2] Trying to make the client to be forced to use weapon slot number 2.
 
Quote:

Originally Posted by Potato Uno (Post 2324338)
Did you strip ALL the weapons first, and then give them the melee only?

Check how TF2BWR does it (too lazy to check myself).

I did only strip secondary and primary.

friagram 07-26-2015 02:13

Re: [TF2] Trying to make the client to be forced to use weapon slot number 2.
 
hook one of the weapon switch functions with sdkhooks and change the weapon back, sdk call resetweapon will help.

StormishJustice 07-26-2015 07:38

Re: [TF2] Trying to make the client to be forced to use weapon slot number 2.
 
Quote:

Originally Posted by Requiesta (Post 2324369)
First, get the melee weapon on the player:

Code:

new iWeapon = GetPlayerWeaponSlot(iClient, 2);

Then force the player to switch to it:

Code:

EquipPlayerWeapon(iClient, iWeapon);
Obviously throw in some validation checks to make sure the plugin doesn't explode.

This one helped.

thank you.


All times are GMT -4. The time now is 21:11.

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