Raised This Month: $ Target: $400
 0% 

FM_AddToFullPack player invisible (and SOLID) for certain player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-26-2021 , 16:00   Re: FM_AddToFullPack player invisible (and SOLID) for certain player
Reply With Quote #1

Use an array of bits to determine which player one can see.

Code:
#define SetPlayerBit(%1,%2)     (%1 |= (1<<(%2&31))) #define ClearPlayerBit(%1,%2)   (%1 &= ~(1 <<(%2&31))) #define CheckPlayerBit(%1,%2)   (%1 & (1<<(%2&31))) new g_visiblePlayers[33] // Return whether target is set as visible to player IsPlayerVisible(player, target) {     return CheckPlayerBit(g_visiblePlayers[player], target) ? true : false } // Make target visible to player MakePlayerVisible(player, target) {     SetPlayerBit(g_visiblePlayers[player], target); } // Make target invisible to player MakePlayerInvisible(player, target) {     ClearPlayerBit(g_visiblePlayers[player], target); }

Your would do something like this

Code:
public client_AddToFullPack_P(es, e, ent, id, hostflags, player, pSet)
{
	if (player && (1 <= ent <= MaxClients) && !IsPlayerVisible(id, ent))
	{
		set_es(es, ES_Effects, EF_NODRAW)
	}
}
MaxClients may be replaced with a global variable holding the number of max players

Code:
new g_maxPlayers public plugin_init() {     g_maxPlayers = get_maxplayers() }
__________________








CrazY. 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 11:29.


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