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

[CSGO] Equip nothing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-18-2018 , 06:11   [CSGO] Equip nothing
Reply With Quote #1

I want for comedy gold to equip nothing for the player. The nothing I equip cannot attack which is good, but displays the last weapon minus the gloves. The code I use is simple:

SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", -1);

How to make the view weapon disappear?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 08-18-2018 , 06:14   Re: [CSGO] Equip nothing
Reply With Quote #2

RemovePlayerItem?
mug1wara is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-18-2018 , 06:19   Re: [CSGO] Equip nothing
Reply With Quote #3

PHP Code:

    int ent 
CreateEntityByName("game_player_equip");
    
DispatchKeyValue(ent"spawnflags""3"); // 1 - use only, 2 - strip weapons, 1 + 2 = 3
    
AcceptEntityInput(ent"Use"Client);
    
AcceptEntityInput(ent"Kill"); 
or for everyone

PHP Code:

    int ent 
CreateEntityByName("game_player_equip");
    
DispatchKeyValue(ent"spawnflags""2");
    
AcceptEntityInput(ent"TriggerForAllPlayers");
    
AcceptEntityInput(ent"Kill"); 
when the round starts
__________________
Ilusion9 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-18-2018 , 06:28   Re: [CSGO] Equip nothing
Reply With Quote #4

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:

    int ent 
CreateEntityByName("game_player_equip");
    
DispatchKeyValue(ent"spawnflags""3"); // 1 - use only, 2 - strip weapons, 1 + 2 = 3
    
AcceptEntityInput(ent"Use"Client);
    
AcceptEntityInput(ent"Kill"); 
or for everyone

PHP Code:

    int ent 
CreateEntityByName("game_player_equip");
    
DispatchKeyValue(ent"spawnflags""2");
    
AcceptEntityInput(ent"TriggerForAllPlayers");
    
AcceptEntityInput(ent"Kill"); 
when the round starts
No. I want to equip nothing, not strip the weapons. I want that when a command is typed ( irrelevant for now ) the player will have nothing in hand as if he has no weapons. But if he presses 1 to 5, he will change to another weapon. The goal is to have the ability to have nothing on hand instead of being forced to having either a pistol, a rifle, a knife, a grenade or C4.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-18-2018 , 13:11   Re: [CSGO] Equip nothing
Reply With Quote #5

Change the active weapon to -1
Mitchell is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-18-2018 , 15:10   Re: [CSGO] Equip nothing
Reply With Quote #6

Quote:
Originally Posted by Mitchell View Post
Change the active weapon to -1
The view model remains.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 08-18-2018 , 17:34   Re: [CSGO] Equip nothing
Reply With Quote #7

Quote:
Originally Posted by eyal282 View Post
The view model remains.
m_bDrawViewModel to 0
Mitchell is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-18-2018 , 18:06   Re: [CSGO] Equip nothing
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
m_bDrawViewModel to 0
m_bDrawViewmodel exists while what you said doesn't.

It works but I need to revert it when changing back to any weapon.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
SHUFEN
Senior Member
Join Date: Jun 2014
Location: Japan, Tokyo
Old 08-18-2018 , 18:23   Re: [CSGO] Equip nothing
Reply With Quote #9

Code:
public void OnClientPutInServer(int client) {
	SDKHook(client, SDKHook_WeaponSwitchPost, OnClientWeaponSwitchPost);
}

public void OnClientWeaponSwitchPost(int client, int weapon) {
	if (GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon") != -1)
		SetEntProp(client, Prop_Data, "m_bDrawViewmodel", 1);
}

public Action TEST_NOTHING(int client, int args) {
	SetEntProp(client, Prop_Data, "m_bDrawViewmodel", 0);
	SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", -1);

	return Plugin_Handled;
}
SHUFEN is offline
Send a message via Skype™ to SHUFEN
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-18-2018 , 18:29   Re: [CSGO] Equip nothing
Reply With Quote #10

Quote:
Originally Posted by SHUFEN.jp View Post
Code:
public void OnClientPutInServer(int client) {
	SDKHook(client, SDKHook_WeaponSwitchPost, OnClientWeaponSwitchPost);
}

public void OnClientWeaponSwitchPost(int client, int weapon) {
	if (GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon") != -1)
		SetEntProp(client, Prop_Data, "m_bDrawViewmodel", 1);
}

public Action TEST_NOTHING(int client, int args) {
	SetEntProp(client, Prop_Data, "m_bDrawViewmodel", 0);
	SetEntPropEnt(client, Prop_Send, "m_hActiveWeapon", -1);

	return Plugin_Handled;
}
I already solved it in a similar manner. But you should know that the active weapon is equal to int weapon in weapon switch post, it is pointless to get it again.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 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 13:44.


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