Raised This Month: $ Target: $400
 0% 

Reading from file error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 08-30-2009 , 20:28   Reading from file error
Reply With Quote #1

Whenever I try using this code I wrote to read from a file and then randomly pick a line (map) from that file, it doesn't work. I tested it and whenever I use the command it always displays "[AMXX] Denied Command Access: 'amx_map_random'!"

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

#define PLUGIN "amx_map random"
#define VERSION "1.0"
#define AUTHOR "BOYSplayCS"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_concmd("amx_map_random""eventChangeMap"ADMIN_SLAY"- Randomly change map");
}

public 
eventChangeMap(idlevelcid)
{
    if (
cmd_access(idlevelcid2))
    {
        new 
mapCycle[64];
        
copy(mapCycle63"mapcycle.txt");
        
        if (
file_exists(mapCycle))
        {
            new 
file fopen(mapCycle"rt");
            
            new 
mapData[64];
            
            while (!
feof(file))
            {
                
fgets(filemapData63);
                
                
server_cmd("changelevel %s"mapData);
            }
        }
    }
    
client_print(idprint_chat"[AMXX] Denied Command Access: 'amx_map_random'!");
    return 
PLUGIN_HANDLED;

BOYSplayCS is offline
 


Thread Tools
Display Modes

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 14:59.


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