Raised This Month: $ Target: $400
 0% 

Precache configs


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Blue Snake.
Member
Join Date: May 2011
Location: Romania
Old 09-29-2011 , 11:16   Precache configs
Reply With Quote #1

How can I precache configs to let players download it? With precache generic it says "Invalid file type...skipping download of file.cfg"...
Or other way to do this? (except client_cmd, it give 'server trying to send invalid command')

PHP Code:
#include <amxmodx>
#include <colorchat>

#define PLUGIN    "Settings"
#define AUTHOR    "Blue Snake."
#define VERSION    "1.0"

new bool:set[33]
new const 
file[16] = "file.cfg"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /execcfg","cmdset")
}

public 
plugin_precache()
{
    if(!
file_exists(file))
    {
        
/* Commands like:
        write_file(file, "bind f ...")
        write_file(file, "alias ... ...")
        */
    
}
    
    
precache_generic(file)
}


public 
cmdset(id)
{
    if(
set[id])
    {
        
ColorChat(idBLUE,"^x04[AMXX]^x01 You've already setted your commands.")
        return 
PLUGIN_HANDLED
    
}
    
    
ColorChat(idBLUE,"^x04[AMXX]^x01 Done.")
    
set[id]=true
    
    client_cmd
(id,"exec %s",file)
    return 
PLUGIN_HANDLED
}


public 
client_connect(id)
    
set[id]=false

public client_disconnect(id)
    
set[id]=false 

Last edited by Blue Snake.; 09-29-2011 at 11:19.
Blue Snake. is offline
 



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 19:36.


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