Raised This Month: $535 Target: $400
 133% 

Solved AddToFullPack hide entity from specific player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 05-28-2021 , 12:20   AddToFullPack hide entity from specific player
Reply With Quote #1

I am very confused as to how this thing works in AMXX. In a module, you would return a value of either MRES_IGNORED (To render the model to said player) or MRES_SUPERCEDE (To not render). I don't really want to set the rendering mode, because it doesn't even work. I am only trying to show/hide models to certain players with return values. Is it possible?

I don't understand how the AMXX equivalent works. Not many threads are correct nor provide enough detail about it.

PHP Code:
public FWAddToFullPackPost(es_handleeenthosthostflagsplayerpset) {

    if (!
player// Check whether target ent is player? Idk...
        
return FMRES_IGNORED;

    if (
KeyEnt(ent) && KeyPlayer(player))
        return 
FMRES_SUPERCEDE// Don't render key ent to key player

    
return FMRES_IGNORED;

The entities show whenever the second if statement is true or false and should only show if it's false.
Tried using 0 and 1 as return values. Nothing.

Last edited by redivcram; 05-28-2021 at 18:03.
redivcram is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-28-2021 , 13:36   Re: AddToFullPack hide entity from specific player
Reply With Quote #2

you can't block anything after it is already happened

Code:
Return 1 if the entity state has been filled in for the ent and the entity will be propagated to the client, 0 otherwise
state is the server maintained copy of the state info that is transmitted to the client
a MOD could alter values copied into state to send the "host" a different look for a particular entity update, etc.
e and ent are the entity that is being added to the update, if 1 is returned
host is the player's edict of the player whom we are sending the update to
player is 1 if the ent/e is a player and 0 otherwise
pSet is either the PAS or PVS that we previous set up.  We can use it to ask the engine to filter the entity against the PAS or PVS.
we could also use the pas/ pvs that we set in SetupVisibility, if we wanted to.  Caching the value is valid in that case, but still only for the current frame
*/
int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet )
try returning 0, but in pre hook

Last edited by jimaway; 05-28-2021 at 13:37.
jimaway is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 05-28-2021 , 15:45   Re: AddToFullPack hide entity from specific player
Reply With Quote #3

Tried hooking Pre before, but I'm still being showed the entity.
redivcram is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-28-2021 , 16:29   Re: AddToFullPack hide entity from specific player
Reply With Quote #4

well probably could do it with orpheu then, if you still want to use fm you'll have to change rendering to make an entity invisible. or you could use groupinfo - that will also make addtofullpack return 0, but it does a lot more than just making it invisible
jimaway is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-28-2021 , 16:31   Re: AddToFullPack hide entity from specific player
Reply With Quote #5

Code:
set_es(es_handle, ES_Effects, get_es(es_handle, ES_Effects) | EF_NODRAW)
__________________




CrazY. is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 05-28-2021 , 18:03   Re: AddToFullPack hide entity from specific player
Reply With Quote #6

Well, I've tried everything now and got CrazY.'s method working, but should be hooked with Post and not Pre. Thanks!
redivcram is offline
Reply


Thread Tools
Display Modes

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 16:57.


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