Raised This Month: $ Target: $400
 0% 

Getting total ents?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 10-27-2006 , 12:48   Getting total ents?
Reply With Quote #1

Is there a way to get the total ents currently running on the server? Since I was wondering how much stuff was being precached.
Drak is offline
Send a message via MSN to Drak
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 10-27-2006 , 13:07   Re: Getting total ents?
Reply With Quote #2

max ents can get with: get_global_int(GL_maxEntities)
Here a little script to get the current ents.
Code:
new maxents public plugin_init() {     maxents = get_global_int(GL_maxEntities)     register_concmd("amx_getcurrentents","get_currentents") }   public get_currentents(id) {     new currentents     for(new i;i<maxents;i++)         if(is_valid_ent(i))             currentents++     client_print(id,print_chat,"Current running %d ents of %d max ents",maxents,currentents) }
__________________
schnitzelmaker is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-27-2006 , 13:09   Re: Getting total ents?
Reply With Quote #3

Code:
#include <fakemeta> new entities public plugin_precache() {     register_forward(FM_Spawn,"handle_spawn")     set_task(1.0,"tell_entities") } public handle_spawn() {     entities++ } public tell_entities() {     client_print(0,print_chat,"This Map has a Total of %i Entities inside!",entities) } // Note that also after the Map has loaded Entities can Spawn. // (Temporary Entities or Monsters from monstermakers etc.) // You maybe want to use remove_forward in tell_entities() // or make another Variable and do variable_new=entities // in tell_entities().  ;)
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 10-27-2006 at 13:14.
Silencer123 is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 10-27-2006 , 13:12   Re: Getting total ents?
Reply With Quote #4

wrong!
Code:
#include <amxmodx> #include <fakemeta> public plugin_init() {     register_plugin("Test", "1.0", "P34nut")         register_concmd("amx_getcurrentents","get_currentents") } public get_currentents() {     new iNum = engfunc(EngFunc_NumberOfEntities)     new iMax = global_get(glb_maxEntities)         client_print(0, print_chat, "Max: %i, Num: %i", iMax, iNum) }

...
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 10-27-2006 , 13:19   Re: Getting total ents?
Reply With Quote #5

Quote:
Originally Posted by Silencer123 View Post
Code:
#include <fakemeta> new entities public plugin_precache() {     register_forward(FM_Spawn,"handle_spawn")     set_task(1.0,"tell_entities") } public handle_spawn() {     entities++ } public tell_entities() {     client_print(0,print_chat,"This Map has a Total of %i Entities inside!",entities) } // Note that also after the Map has loaded Entities can Spawn. // (Temporary Entities or Monsters from monstermakers etc.) // You maybe want to use remove_forward in tell_entities() // or make another Variable and do variable_new=entities // in tell_entities().  ;)
I didn't know you can use client print in precache....(Sarcasm intended).
organizedKaoS is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-27-2006 , 14:50   Re: Getting total ents?
Reply With Quote #6

Doh!
__________________
EAT YOUR VEGGIES
Silencer123 is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 10-27-2006 , 15:00   Re: Getting total ents?
Reply With Quote #7

Quote:
Originally Posted by Silencer123 View Post
Doh!
LOL....must be the sleep eh...get more or you'll end up a zombie
organizedKaoS is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 10-27-2006 , 15:11   Re: Getting total ents?
Reply With Quote #8

Ah, thank you.
Drak is offline
Send a message via MSN to Drak
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 04:47.


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