Raised This Month: $ Target: $400
 0% 

Flagging an entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-24-2013 , 15:16   Re: Flagging an entity
Reply With Quote #2

How many types you have ?

If it is only bools :
PHP Code:
#define SetEntBits(%1,%2)    %1[%2>>5] |=  1<<(%2 & 31)
#define ClearEntBits(%1,%2)    %1[%2>>5] &= ~( 1 << (%2 & 31) )
#define GetEntBits(%1,%2)    %1[%2>>5] &   1<<(%2 & 31)

new g_iYellowEntities[64// 64 * 32 allows 2048 ent to be flagged as 0 or 1

// In macros, %1 stands for g_iYellowEntities, %2 for ent index

// mark entity as yellow :

SetEntBits(g_iYellowEntitiesent
But if you have few types, less than 255, you can do :

PHP Code:
new g_cEntityType[2048 char// this array size is 512 cell array (2048 / 4)

// then you use

g_cEntityTypeent } = Type // where type is a byte 0-255, so you can have 255 types 

On default servers, max entity num is now 1800.


Problem using pev_*** is that other plugins could alter it.


Also, you are theorical and abstract, depending of what you exactly need to do, there might be better solutions.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-24-2013 at 15:17.
ConnorMcLeod is offline
 



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 10:54.


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