hide entity
Hello.
Im trying to find a way to hide an entity which is being used in another plugin. For example an entity class name(d) "ent_hat" is being used in a plugin, if i want to get the classname of this entity in another plugin how can i do it? Here's what im trying to do to get entity class name from another plugin: static classname[32] pev(ent, pev_classname, classname, 31) if(is_valid(ent)) { if(equal(classname, "ent_hat")) { do something// } } |
Re: hide entity
Where are you putting that code? Also, I think you'll probably want to use something like find_ent_by_class().
|
Re: hide entity
PHP Code:
|
Re: hide entity
Quote:
|
Re: hide entity
Thanks, I'll try it out !
|
Re: hide entity
i tried using this: it works, but it lags the server uses too much CPU suddenly and spams Errors in Console:
ERRORS: L 08/07/2023 - 00:11:47: [FAKEMETA] Invalid entity L 08/07/2023 - 00:11:47: [AMXX] Displaying debug trace (plugin "Untitled.amxx", version "1.0") L 08/07/2023 - 00:11:47: [AMXX] Run time error 10: native error (native "pev") L 08/07/2023 - 00:11:47: [AMXX] [0] Untitled.sma::ForwardAddToFullPack (line 3453) L 08/07/2023 - 00:11:47: [FAKEMETA] Invalid entity Thats the error which spams in my console and i have tried your way too @Mr.Pickles if(!is_valid_ent(ent)) return 1; if(equal(classname, "ent_hat") == ent || ent == equal(classname, "ent_hat")) { set_es( es_handle, ES_RenderMode, kRenderTransAlpha ); set_es( es_handle, ES_RenderAmt, 0 ); } |
Re: hide entity
SOLVED!
Used: new entu = engfunc( EngFunc_FindEntityByString, -1, "classname", "ent_hat" ); Thanks for your help guys! |
Re: hide entity
Quote:
You could also try sending the error it gave you, you sent the error of your code only. |
Re: hide entity
Quote:
Also, if the entity is a long-lived entity (e.g. created once during the map), you only need to search for it once and simply save the entity ID and re-use it when you need to do something with it. |
Re: hide entity
Quote:
|
All times are GMT -4. The time now is 16:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.