Raised This Month: $ Target: $400
 0% 

Precache Resource


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bos93
Veteran Member
Join Date: Jul 2010
Old 05-16-2012 , 17:54   Precache Resource
Reply With Quote #1

PHP Code:
L 05/17/2012 01:48:01Log file started (file "cstrike\addons\amxmodx\logs\PrecacheList.log") (game "cstrike") (amx "1.8.1.3746")
L 05/17/2012 01:48:01: <1><sprites/scope_arc.tga>
L 05/17/2012 01:48:01: <2><sprites/scope_arc_nw.tga>
L 05/17/2012 01:48:01: <3><sprites/scope_arc_ne.tga>
L 05/17/2012 01:48:01: <4><sprites/scope_arc_sw.tga>
L 05/17/2012 01:48:01: <6><weapons/zoom.wav>
L 05/17/2012 01:48:01: <7><weapons/knife_deploy1.wav>
L 05/17/2012 01:48:01: <8><player/pl_step1.wav>
L 05/17/2012 01:48:01: <9><player/pl_step2.wav>
L 05/17/2012 01:48:01: <10><player/pl_step3.wav>
L 05/17/2012 01:48:01: <11><player/pl_step4.wav>
L 05/17/2012 01:48:01: <12><common/null.wav>
L 05/17/2012 01:48:01: <13><ambience/lv_jubilee.wav>
L 05/17/2012 01:48:01: <14><ambience/a1_citytraffic.wav>
L 05/17/2012 01:48:01: <15><ambience/E55_train.wav>
L 05/17/2012 01:48:01: <16><ambience/truck2.wav>
L 05/17/2012 01:48:01: <17><ambience/alarm1.wav>
L 05/17/2012 01:48:01: <18><ambience/E55_aquatica.wav>
L 05/17/2012 01:48:01: <19><ambience/motor.wav>
L 05/17/2012 01:48:01: <69><sprites/voiceicon.spr
L 05/17/2012 - 01:48:01: <19><ambience/motor.wav>

Where 50 resources?

L 05/17/2012 - 01:48:01: <69><sprites/voiceicon.spr>

PHP Code:
/* AMX Mod X Plugin

* (c) Copyright 2008, ConnorMcLeod 
* This file is provided as is (no warranties). 

*/ 

#include <amxmodx>
#include <fakemeta>

#define MAX_PRECACHE    512
#define MAX_FILE_LENGHT    128

new g_iCounter

new g_szPrecachedFiles[MAX_PRECACHE+1][MAX_FILE_LENGHT+1]
new 
g_szCustomFiles[MAX_PRECACHE+1][MAX_FILE_LENGHT+1]

new 
g_iForwardsIds[3]

public 
plugin_precache()
{
    
register_plugin("Precache Management""1.0.0""ConnorMcLeod")

    
g_iForwardsIds[0] = register_forward(FM_PrecacheModel"Precache_Post"1)
    
g_iForwardsIds[1] = register_forward(FM_PrecacheSound"Precache_Post"1)
    
g_iForwardsIds[2] = register_forward(FM_PrecacheGeneric"Precache_Post"1)
}

public 
plugin_natives()
{
    
register_library("precache")
    
register_native("can_precache","native_can_precache")
    
register_native("PrecacheModel","native_PrecacheModel")
    
register_native("PrecacheSound","native_PrecacheSound")
    
register_native("PrecacheGeneric","native_PrecacheGeneric")
}

public 
plugin_init()
{
    
unregister_forward(FM_PrecacheModelg_iForwardsIds[0], 1)
    
unregister_forward(FM_PrecacheSoundg_iForwardsIds[1], 1)
    
unregister_forward(FM_PrecacheGenericg_iForwardsIds[2], 1)

    new const 
szLogFile[] = "PrecacheList.log"
    
new const szLogFile2[] = "PrecacheListCust.log"
    
for(new i=1i<=MAX_PRECACHEi++)
    {
        if(
g_szPrecachedFiles[i][0])
        {
            
log_to_file(szLogFile"<%d><%s>"ig_szPrecachedFiles[i])
        }
        if(
g_szCustomFiles[i][0])
        {
            
log_to_file(szLogFile2"<%d><%s>"ig_szCustomFiles[i])
        }
    }
    
log_to_file(szLogFile"%i files precached"g_iCounter)
    
pause("ad")
}

public 
Precache_Post(const szFile[])
{
    static 
iVal
    iVal 
get_orig_retval()
    
update_counter(iVal)

    if( !
g_szPrecachedFiles[iVal][0] )
    {
        
formatex(g_szPrecachedFiles[iVal], MAX_FILE_LENGHTszFile)
    }
}

update_counter(iVal)
{
    if( 
iVal g_iCounter )
    {
        
g_iCounter iVal
        
return 1
    
}
    return 
0
}

public 
native_can_precache(iPluginiParams)
{
    return (
g_iCounter MAX_PRECACHE)
}

public 
native_PrecacheModel(iPluginiParams)
{
    if(
iParams != 1)
        return -
1

    
static szFile[MAX_FILE_LENGHT], iVal
    get_string
(1szFileMAX_FILE_LENGHT-1)

    
iVal engfunc(EngFunc_PrecacheModelszFile)

    
update_counteriVal )
    if( !
g_szCustomFiles[iVal][0] )
    {
        
formatex(g_szCustomFiles[iVal], MAX_FILE_LENGHTszFile)
    }

    return 
iVal
}

public 
native_PrecacheSound(iPluginiParams)
{
    if(
iParams != 1)
        return -
1

    
static szFile[MAX_FILE_LENGHT], iVal
    get_string
(1szFileMAX_FILE_LENGHT-1)

    
iVal engfunc(EngFunc_PrecacheSoundszFile)

    
update_counteriVal )
    if( !
g_szCustomFiles[iVal][0] )
    {
        
formatex(g_szCustomFiles[iVal], MAX_FILE_LENGHTszFile)
    }

    return 
iVal
}

public 
native_PrecacheGeneric(iPluginiParams)
{
    if(
iParams != 1)
        return -
1

    
static szFile[MAX_FILE_LENGHT], iVal
    get_string
(1szFileMAX_FILE_LENGHT-1)

    
iVal engfunc(EngFunc_PrecacheGenericszFile)

    
update_counteriVal )
    if( !
g_szCustomFiles[iVal][0] )
    {
        
formatex(g_szCustomFiles[iVal], MAX_FILE_LENGHTszFile)
    }

    return 
iVal

How do I know all the Precache Resouce?
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
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 16:21.


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