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

Invisible knife in TT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mariano Gyt
Junior Member
Join Date: Aug 2019
Old 08-21-2019 , 15:34   Invisible knife in TT
Reply With Quote #1

Invisible knife in TT, as in a HNS
HELP!
Mariano Gyt is offline
GetRektByNoob
Member
Join Date: Nov 2018
Old 08-22-2019 , 18:13   Re: Invisible knife in TT
Reply With Quote #2

you need to post something (code, how to recreate....) to get help... creating a thread that says in 1 short sentence what's the problem and "HELP!" isn't enough information for someone to help you...
__________________
𝓓𝓲𝓼𝓬𝓸𝓻𝓭 » GetRektByNoob#5272
𝓢𝓽𝓮𝓪𝓶 » https://steamcommunity.com/profiles/76561198805764302/
GetRektByNoob is offline
Mariano Gyt
Junior Member
Join Date: Aug 2019
Old 08-23-2019 , 00:38   Re: Invisible knife in TT
Reply With Quote #3

Quote:
Originally Posted by GetRektByNoob View Post
you need to post something (code, how to recreate....) to get help... creating a thread that says in 1 short sentence what's the problem and "HELP!" isn't enough information for someone to help you...


What I need is to take the knife away from the tt, that the tt can't see the knife, that he has it invisible.

Last edited by Mariano Gyt; 08-23-2019 at 00:39.
Mariano Gyt is offline
GetRektByNoob
Member
Join Date: Nov 2018
Old 08-23-2019 , 07:22   Re: Invisible knife in TT
Reply With Quote #4

First can you some code to work off it or some information
Second what is tt
Third to delete someone knife you can do
PHP Code:
RemovePlayerItem(clientGetPlayerWeaponSlot(client,1)); 
I'm not sure if the Remove function it's something from sourcemod or I created bc I can't remember and i can't check the api since I'm from the phone, and last thing I'm also not sure If slot 1 is the knife slot so you need to check it.
__________________
𝓓𝓲𝓼𝓬𝓸𝓻𝓭 » GetRektByNoob#5272
𝓢𝓽𝓮𝓪𝓶 » https://steamcommunity.com/profiles/76561198805764302/

Last edited by GetRektByNoob; 08-23-2019 at 07:23.
GetRektByNoob is offline
ShD3luxe
Member
Join Date: Aug 2019
Location: Localhost
Old 08-23-2019 , 07:43   Re: Invisible knife in TT
Reply With Quote #5

Quote:
Originally Posted by GetRektByNoob View Post
First can you some code to work off it or some information
Second what is tt
Third to delete someone knife you can do
PHP Code:
RemovePlayerItem(clientGetPlayerWeaponSlot(client,1)); 
I'm not sure if the Remove function it's something from sourcemod or I created bc I can't remember and i can't check the api since I'm from the phone, and last thing I'm also not sure If slot 1 is the knife slot so you need to check it.
RemovePlayerItem will detach the item from the player you need to kill the entity too , also 1 is secondary and 2 is melee.
PHP Code:
int weaponIndex GetPlayerWeaponSlot(client2);
if(
weaponIndex != -1)
{
    
RemovePlayerItem(clientweaponIndex);
    
AcceptEntityInput(weaponIndex"Kill");

But this will not make the knife invisible it will remove it , you can fake the invisible thing by giving the knife back to the player when you need the knife to be visible and remove it when you want the knife to be invisible.
You can set the alpha of an entity so you can do this too for the knife (which is a better way ):
PHP Code:
stock void MakeKnifeInvisible(int clientbool set true)

        
int entity GetPlayerWeaponSlot(client2); 
        if (
entity != -1)
        { 
            
SetEntityRenderMode(entityRENDER_TRANSCOLOR); 
            
SetEntityRenderColor(entity___set 0:255); 
        } 

AFAIk,even if the knife is invisible the entity still exists and will do damage.

Last edited by ShD3luxe; 08-23-2019 at 07:49.
ShD3luxe is offline
GetRektByNoob
Member
Join Date: Nov 2018
Old 08-23-2019 , 08:03   Re: Invisible knife in TT
Reply With Quote #6

Can you explain what is the difference between AcceptIntityInput("kill") and RemovePlayerItem?
also making the knife invisible the player will still see that be holds something in his hand and at the right bottom he can still see the knife icon so it's pretty useless...
__________________
𝓓𝓲𝓼𝓬𝓸𝓻𝓭 » GetRektByNoob#5272
𝓢𝓽𝓮𝓪𝓶 » https://steamcommunity.com/profiles/76561198805764302/

Last edited by GetRektByNoob; 08-23-2019 at 08:06.
GetRektByNoob is offline
ShD3luxe
Member
Join Date: Aug 2019
Location: Localhost
Old 08-23-2019 , 08:14   Re: Invisible knife in TT
Reply With Quote #7

Quote:
Originally Posted by GetRektByNoob View Post
Can you explain what is the difference between AcceptIntityInput("kill") and RemovePlayerItem?
also making the knife invisible the player will still see that be holds something in his hand and at the right bottom he can still see the knife icon so it's pretty useless...
RemovePlayerItem will remove the weapon from the player but the entity will still exist. -> https://sm.alliedmods.net/new-api/sd...movePlayerItem ( the wiki is not really specific about this )
AcceptEntityInput invokes a input method of an entity in this case the kill method which will kill the entity.
Well yeah but it may be the behaviour he was looking for that's why I listed that method too.

Last edited by ShD3luxe; 08-23-2019 at 08:18. Reason: doc
ShD3luxe is offline
GetRektByNoob
Member
Join Date: Nov 2018
Old 08-23-2019 , 08:27   Re: Invisible knife in TT
Reply With Quote #8

where can i find all the AcceptEntityInput methods and examples if you don't mind...?
__________________
𝓓𝓲𝓼𝓬𝓸𝓻𝓭 » GetRektByNoob#5272
𝓢𝓽𝓮𝓪𝓶 » https://steamcommunity.com/profiles/76561198805764302/
GetRektByNoob is offline
ShD3luxe
Member
Join Date: Aug 2019
Location: Localhost
Old 08-23-2019 , 08:42   Re: Invisible knife in TT
Reply With Quote #9

https://developer.valvesoftware.com/...egory:Entities here are all entities from valve you can find all the inputs in the Inputs section of each entity. There are not many stuff to explain you just need to get the index of that entity and then using AcceptEntityInput u can call that input function , there are also flags for each entity which are useful .

Here is the api for AcceptEntityInput : https://sm.alliedmods.net/new-api/sd...eptEntityInput
Also to set a flag you can do :
Code:
	new ent = -1; 
	while((ent = FindEntityByClassname(ent, "func_button")) != -1) 
	{ 
		SetEntProp(ent, Prop_Data, "m_spawnflags", GetEntProp(ent, Prop_Data, "m_spawnflags")|512);    
		SetEntProp(ent, Prop_Data, "m_spawnflags", GetEntProp(ent, Prop_Data, "m_spawnflags")|256); 
	}
This is for the func_button entiti and will set the flag 512( which is for taking damage and 256 which is for touching)
This is just an example from one of my plugins.You can do many stuff with entities in sm .
EDIT: Those methods are different for each entity (some may be the same) but you will find them all in that link.
For inputs with parameters check this link : https://forums.alliedmods.net/showthread.php?t=177591

Last edited by ShD3luxe; 08-23-2019 at 08:50.
ShD3luxe is offline
GetRektByNoob
Member
Join Date: Nov 2018
Old 08-23-2019 , 09:23   Re: Invisible knife in TT
Reply With Quote #10

thanks
__________________
𝓓𝓲𝓼𝓬𝓸𝓻𝓭 » GetRektByNoob#5272
𝓢𝓽𝓮𝓪𝓶 » https://steamcommunity.com/profiles/76561198805764302/
GetRektByNoob 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:04.


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