AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Precache Plugin (https://forums.alliedmods.net/showthread.php?t=139771)

padilha007 10-05-2010 02:32

Precache Plugin
 
For some reason, this plugin is not working, why?

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Precache"
#define VERSION "01"
#define AUTHOR "Dev Team"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()
{
    new 
path[128], fhMapName[32];
    
get_configsdir(path127);
    
get_mapname(MapNamesizeof MapName -1);
    
format(path127"%s/map/%s.ini"pathMapName);
    
    if(!
file_exists(path))
        return;

    
fh fopen(path"rt")
    if(!
fh)
        return;

    while(!
feof(fh))
    {
        new 
Line[128];
        
fgets(fhLinesizeof Line 1);
        
        
precache_generic(Line);
    }

    
fclose(fh);



Exolent[jNr] 10-05-2010 03:00

Re: Precache Plugin
 
What is Linha?
And you included engine for no reason.

Hunter-Digital 10-05-2010 03:41

Re: Precache Plugin
 
And you're creating a variable inside a loop, create it instead at the start of the function along with the others.

padilha007 10-05-2010 12:10

Re: Precache Plugin
 
Tnx Exolent and Hunter;

Solved.


All times are GMT -4. The time now is 10:20.

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