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

pev_valid cache


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 07-11-2010 , 16:10   pev_valid cache
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define ENT_NUM 1024

new ent_valid[ENT_NUM]

public 
plugin_precache() {
    
register_forward(FM_CreateEntity,"ent_create")
    
register_forward(FM_CreateNamedEntity,"ent_create")
    
register_forward(FM_RemoveEntity,"ent_kill")    
}

public 
ent_create(ent)
    
ent_valid[ent] = true;
    
public 
ent_kill(ent)
    
ent_valid[ent] = false
Would such a caching work properly?

Last edited by Empowers; 07-11-2010 at 16:15.
Empowers is offline
Send a message via ICQ to Empowers
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-11-2010 , 17:17   Re: pev_valid cache
Reply With Quote #2

No.
Use pev_valid is fine.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 07-12-2010 , 05:44   Re: pev_valid cache
Reply With Quote #3

In my plugin I'm using pev_valid in the begining of prethink and addtofullpack. Would it make high CPU usage?
Empowers is offline
Send a message via ICQ to Empowers
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-12-2010 , 05:47   Re: pev_valid cache
Reply With Quote #4

It's a small native, it's fine. But if you can, use it at the right moment.
__________________
Arkshine is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 07-12-2010 , 05:49   Re: pev_valid cache
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
It's a small native, it's fine. But if you can, use it at the right moment.
Ok thx
Empowers is offline
Send a message via ICQ to Empowers
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 14:36.


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