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

Solved hide entity


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2023 , 22:14   Re: hide entity
Reply With Quote #11

I didn't say anything about needing to modify the plugin that creates the entities. Let me put it another way in hopes that it might make more sense. If you know when it's created, you can simply find the entity (by class the same way it's done above) and then you can store that value and simply use that value later when you need it. You'll still need to check if it's valid but you don't need to search the entire entity list every time you need it.
__________________
fysiks is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-08-2023 , 23:04   Re: hide entity
Reply With Quote #12

Quote:
Originally Posted by fysiks View Post
I didn't say anything about needing to modify the plugin that creates the entities. Let me put it another way in hopes that it might make more sense. If you know when it's created, you can simply find the entity (by class the same way it's done above) and then you can store that value and simply use that value later when you need it. You'll still need to check if it's valid but you don't need to search the entire entity list every time you need it.
Quote:
If you know when it's created...
That is the problem, where they are created is in plugin number 1, and where you are going to place them invisible in plugin number 2, the only way to get an index between both plugins is by creating a library for them to communicate or save them in a iuser /vuser, what you could do is save the index with the first find ent by class, if you are going to repeat the effect later, you use the saved index with the find ent by class, checking if it is valid of course, but you will have to do several checks if the index changes, just use find ent by class to hide it then you won't have any problem

Last edited by MrPickles; 08-08-2023 at 23:06.
MrPickles is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2023 , 23:10   Re: hide entity
Reply With Quote #13

Right, it depends on how the plugin works. I don't know how this random, unnamed plugin works so I had to add that qualifier.
__________________
fysiks is offline
Tote
Senior Member
Join Date: Jul 2023
Old 08-09-2023 , 03:13   Re: hide entity
Reply With Quote #14

Quote:
Originally Posted by MrPickles View Post
The code that I gave you must have worked perfectly, you don't need to use add to full pack for that, with that,you are searching each frame for the entity with that classname, with which I gave you only activate/deactivate invisibility once.

You could also try sending the error it gave you, you sent the error of your code only.
I've already sent the error.
Spams message "[FAKEMETA] Invalid entity." And it lags out the server maybe because it's used in FMAddtoPlayerPack? I guess it spams it too much time which can cause lag ?
EDIT: What about something like this:
new bool:check;

public ForwardAddToFullPack( es_handle, e, ent, host, hostflags, player, pset )
{
new entu = engfunc( EngFunc_FindEntityByString, -1, "classname", "ent_hat" );
if(ent == entu || entu == ent)
{
if(check == true)
{
return PLUGIN_HANDLED:
}
else
{
set_es( es_handle, ES_RenderMode, kRenderTransAlpha );
set_es( es_handle, ES_RenderAmt, 0 );
check = true
}
}
}
}

Last edited by Tote; 08-09-2023 at 03:17.
Tote is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-09-2023 , 22:29   Re: hide entity
Reply With Quote #15

  1. Trying to find the entity by classname is not a quick function to call which is why it was suggested to only find the entity when you need to set the visibility.
  2. Why don't you just modify the plugin that creates this entity to hide or not create the entity in the first place? Or remove the plugin if you don't want the entities at all.
__________________

Last edited by fysiks; 08-09-2023 at 22:29.
fysiks is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 08-11-2023 , 19:36   Re: hide entity
Reply With Quote #16

Just use the code that I sent you, it doesn't have any errors and it's better than using add to full pack, that's all.
MrPickles 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 17:26.


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