View Single Post
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-01-2015 , 14:24   Re: SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011
Reply With Quote #388

If I use GivePlayerItem then the weapon_% acts as expected, but what I want to do is give the player the weapon, but when I give them a primary weapon, I don't want them to automatically switch to it.

Scenario:
In my KPD Ratio plugin, if a player reaches a certain KPD, it restricts certain weapons. What I want is if the player is using a pistol when they exceed the set KPD and the plugin removes the restricted rifle (AWP for example) and gives a replacement weapon (SSG 08 for example), I don't want the player to auto-switch to the SSG 08, which is what happens when I use GivePlayerItem.

The script I posted, using SMLib works great, sans that "knife" issue that part of the game thinks the weapon is. It's weird, the console shows that I made a kill with an SSG 08 (if that's the replacement weapon), but the in-game chat says I made a kill with a knife and gives me the knife kill bonus and if I drop the SSG 08, it says I just dropped my knife.

I'm guessing I'm missing a property to set on the entity when it is created, but I'm at a loss as to what property I need.

Maybe I'll add a request to the GivePlayerItem to have a bool:switchTo or something.

...:: TnT Edit ::...
Or maybe not. I'll mess around and see what work around I can come up with, unless Berni, or someone, knows what is missing to not make CS:GO treat this weapon like a "knife".
__________________
View my Plugins | Donate

Last edited by TnTSCS; 01-01-2015 at 14:38.
TnTSCS is offline