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

[CS:GO] Hide Knife, Keep Crosshair


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Akitake
New Member
Join Date: Apr 2018
Old 04-17-2018 , 13:02   [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #1

Hi,

As the title says I want to have it where when the players spawn, they get stripped of all their weapons including the knife, but have the choice to keep their crosshair or not (for surfing)


I have tried many ways to "remove" the knife, teleporting it away, destroying it, dropping it, set its alpha to 0, change its render mode, nothing seems to work.
Getting rid of the viewmodel is the closest I can get to what I want, but even then you can hear the knife sound when clicking.

I even tried to maybe add just a dot in the middle of the screen for every client using r_screenoverlay but that isn't very elegant.


Any idea on how to do this ? It would be greatly appreciated !

Last edited by Akitake; 04-17-2018 at 13:04.
Akitake is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 04-17-2018 , 15:13   Re: [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #2

Code:
SetEntProp(client_index, Prop_Send, "m_iHideHUD", GetEntProp(client_index, Prop_Send, "m_iHideHUD") | HIDEHUD_WEAPONSELECTION); 
RemovePlayerItem(weapons...)
If dont work on player_spawn try timer
If you dont have crosshair , you can switch to spawned weapon with 0 ammo
Code:
new weapon = GivePlayerItem(client, "weapon_usp_silencer");
SetEntProp(weapon, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
SetEntProp(weapon, Prop_Send, "m_iClip1", 0);
give weapon without ammo work only with timer after player_spawn

Last edited by Indarello; 04-17-2018 at 15:20.
Indarello is offline
Akitake
New Member
Join Date: Apr 2018
Old 04-18-2018 , 03:24   Re: [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #3

Quote:
Originally Posted by Indarello View Post
Code:
SetEntProp(client_index, Prop_Send, "m_iHideHUD", GetEntProp(client_index, Prop_Send, "m_iHideHUD") | HIDEHUD_WEAPONSELECTION); 
RemovePlayerItem(weapons...)
I don't see how that's any different than having "mp_drop_knife_enable 1", no crosshair, no knife.

Quote:
Originally Posted by Indarello View Post
Code:
new weapon = GivePlayerItem(client, "weapon_usp_silencer");
SetEntProp(weapon, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
SetEntProp(weapon, Prop_Send, "m_iClip1", 0);
Again, I asked for the player to not see a weapon in his viewmodel, basically this is for a surfing server where you can't kill/be killed anyways. I just want nothing obstructing the surfer's view except his crosshair if he decides to have it. I know it's possible, I've seen it done.
I don't care how the player looks to other players, if it looks like he still has a knife or not, I just want everyone's own fps view to not have anything in it.

PS: Yes, I have tried both code snippets out before saying they're not what I want.

Last edited by Akitake; 04-18-2018 at 03:27.
Akitake is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 04-18-2018 , 09:05   Re: [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #4

Quote:
Originally Posted by Akitake View Post
I don't see how that's any different than having "mp_drop_knife_enable 1", no crosshair, no knife.



Again, I asked for the player to not see a weapon in his viewmodel, basically this is for a surfing server where you can't kill/be killed anyways. I just want nothing obstructing the surfer's view except his crosshair if he decides to have it. I know it's possible, I've seen it done.
I don't care how the player looks to other players, if it looks like he still has a knife or not, I just want everyone's own fps view to not have anything in it.

PS: Yes, I have tried both code snippets out before saying they're not what I want.
Please make screenshoot what you want, on server which existed and make screenshoot what my code make
Indarello is offline
Akitake
New Member
Join Date: Apr 2018
Old 04-18-2018 , 15:06   Re: [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #5

What I want

• No weapons on screen.
• Crosshair appearing in the middle.

Hide hud.. technique?

This is basically like enabling "mp_drop_knife_enable 1" in game, it just allows for a smooth drop of the knife, but it doesn't show the crosshair.

Code: https://hastebin.com/qerudijado.cpp

Screenshot:



USP Proposed Technique's

The code does what you'd expect it to, allows you to drop your knife then replaces it with a 0 bullet pistol, but that's not what I asked for.

Code: https://hastebin.com/dazacazepo.cpp

Screenshot:

Last edited by Akitake; 04-18-2018 at 15:09.
Akitake is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 04-18-2018 , 15:40   Re: [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #6

PHP Code:
SetEntProp(clientProp_Send"m_bDrawViewmodel"0); 
Pretty sure this is what you are fishing for.
__________________
xines is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 04-18-2018 , 15:42   Re: [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #7

Why not just give players their knives and allow them to hide the view model?
weapon_reticle_knife_show 1
Mitchell is offline
Indarello
Senior Member
Join Date: Nov 2015
Location: Russia
Old 04-18-2018 , 16:18   Re: [CS:GO] Hide Knife, Keep Crosshair
Reply With Quote #8

I don't see hidehud in code where you give pistol
And where is screenshoot of what you want on server where it existed

Last edited by Indarello; 04-18-2018 at 16:18.
Indarello 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 08:39.


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