AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   512 Model limit (https://forums.alliedmods.net/showthread.php?t=126267)

meTaLiCroSS 05-07-2010 17:13

512 Model limit
 
As this thread: http://forums.alliedmods.net/showthread.php?t=73238

How i can get the number of the current precached models including models precached by plugins?

Jelle 05-07-2010 17:26

Re: 512 Model limit
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define DEBUG_PREFIX "[AMXX DEBUG]"

new gDebugEnt 0

new iTaskEnt 99921001

public plugin_init()
{
    
register_plugin("Test Plugin""0.1""Piegtas")
    
register_concmd("amx_debug_ent""DebugEnt")
}

public 
DebugEnt()
{
    if(
gDebugEnt)
    {
        
remove_task(iTaskEnt)
        
gDebugEnt 0
        
return
    }

    
gDebugEnt 1
    set_task
(2.0"ShowEntStats"iTaskEnt""0"b")
    return


Not made by me!

Arkshine 05-07-2010 18:43

Re: 512 Model limit
 
precache_model() returns an index which is actually the number of precached model. If you see 240, it means you have precached the 240th model.

joropito 05-07-2010 19:43

Re: 512 Model limit
 
Quote:

Originally Posted by Jelle (Post 1173718)
Not made by me!

I made it but there's a lack of code there!

EDIT:

Here's the script http://forums.alliedmods.net/showpos...1&postcount=26

It only shows how many entities are in the map. Not precached resources.


EDIT2:

Make a plugin like this

- at precache, hook FM_PrecacheSound , FM_PrecacheModel , FM_PrecacheGeneric (all in post)
- at each call, check if the returned value are bigger than the previous (is a global variable to store it if it's bigger)
- at plugin_init unhook those forwards
- you will have in that global the last number like Arkshine said

I think it will work.


All times are GMT -4. The time now is 03:39.

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