From 0c36613352b40900066990254d58f047add1f64b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 24 Jul 2005 03:23:35 +0000 Subject: [PATCH] Deprecated file read natives until they can be rewritten --- plugins/include/amxmodx.inc | 6 ++++-- plugins/include/file.inc | 30 ++---------------------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc index 91891fe7..dbaaa2fa 100755 --- a/plugins/include/amxmodx.inc +++ b/plugins/include/amxmodx.inc @@ -689,7 +689,8 @@ native find_plugin_byfile(const filename[], ignoreCase=1); //If you set ml to 1, everything will be preformatted // with the multi-lingual system. //NOTE: ml=1 currently is not enabled. -native menu_create(title[], ml=0); +//handler[] will be called when someone presses a key on your menu +native menu_create(title[], handler[], ml=0); //Creates a menu item callback handler. //The callback handler is passed the playerid, menuid, and itemid. @@ -698,7 +699,8 @@ native menu_makecallback(function[]); //Adds an item to a menu. When displayed, the name will be shown. //If the player does not have the access it is disabled. -//If you set callbac, the callback will be activated beforehand. +//If you set callback, the callback will be called before the item is printed on the screen. +//this lets you change it in real time depending on conditions. native menu_additem(menu, const name[], const command[]="", paccess=0, callback=-1); //returns how many pages are in a menu diff --git a/plugins/include/file.inc b/plugins/include/file.inc index 4630923a..e5aae8e6 100755 --- a/plugins/include/file.inc +++ b/plugins/include/file.inc @@ -50,22 +50,10 @@ native fopen(const filename[],const mode[]); native fclose(file); //Read a file for ret_size length native fread(file,ret[],ret_size); -//Write a file -native fwrite(file,const str[],{Float,Sql,Result,_}:...); -//Check if at the end of a file -native feof(file); -//Seek a file -native fseek(file,pos,type); -//Rewind a file (reset) -native rewind(file); -//Flush a file -native fflush(file); -//Scan a file by a format -native fscanf(file,const str[],{Float,Sql,Result,_}:...); -//Returns the current file position pointer -native ftell(file); + //Return the size of a file native filesize(const filename[],{Float,Sql,Result,_}:...); + //Delete a file (delete_file macro) native unlink(const filename[],{Float,Sql,Result,_}:...); @@ -74,20 +62,6 @@ native open_dir(dir[], firstfile[], length); native next_file(dirh, buffer[], length); native close_dir(dirh); -//These are type specific file getting and writing commands: -//c=char, s=short, l=long, i=int, f=float -native fgetc(file); //read char (size 1) -native fgets(file); //read short (size 2) -native fgetl(file); //read long (size 4) -native fgeti(file); //read int (size 4) -native Float:fgetf(file); //read float (size 4) - -native fputc(file,num); //write char (size 1) -native fputs(file,num); //write short (size 2) -native fputl(file,num); //write long (size 4) -native fputi(file,num); //write int (size 4) -native fputf(file,Float:num); //write float (size 4) - stock bool:file_copy(const SOURCE[], const TARGET[], error[], const ERRORLEN, const bool:REPLACE_TARGET = false) { if (!file_exists(SOURCE)) { format(error, ERRORLEN, "File copy error: Source ^"%s^" doesn't exist!", SOURCE)