Raised This Month: $ Target: $400
 0% 

Precache Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
padilha007
Senior Member
Join Date: Jul 2008
Old 10-05-2010 , 02:32   Precache Plugin
Reply With Quote #1

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);

__________________


Last edited by padilha007; 10-05-2010 at 12:07.
padilha007 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-05-2010 , 03:00   Re: Precache Plugin
Reply With Quote #2

What is Linha?
And you included engine for no reason.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-05-2010 , 03:41   Re: Precache Plugin
Reply With Quote #3

And you're creating a variable inside a loop, create it instead at the start of the function along with the others.
__________________
Hunter-Digital is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 10-05-2010 , 12:10   Re: Precache Plugin
Reply With Quote #4

Tnx Exolent and Hunter;

Solved.
__________________

padilha007 is offline
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 10:20.


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