View Single Post
stupok
Veteran Member
Join Date: Feb 2006
Old 07-31-2007 , 19:41   Re: read from file and print in chat
Reply With Quote #4

I think this should do it:

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Example" #define VERSION "1.0" #define AUTHOR "stupok69" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("command", "print_from_file", ADMIN_KICK) } public print_from_file(id, level, cid) {     if(!cmd_access(id, level, cid, 1))         return PLUGIN_HANDLED         new file = fopen("filepath", "rt")         new text[256], textlen     if(file)     {         new buffer[256]                 while(!feof(file))         {             fgets(file, buffer, 255)                         if(buffer[0])             {                 textlen += format(text[textlen], 255-textlen, "%s ", buffer)             }         }     }         fclose(file)         client_print(id, print_chat, "* %s", text)         return PLUGIN_HANDLED }
__________________
stupok is offline