26.06.2013, 09:49
(
Last edited by Excel™; 21/02/2015 at 08:12 AM.
)
e_file
Version 1
Update: 26 June, 2013
Credits
- Excel
- dFiles Creator
Description
Hello SAMP users. Today i present you the best, not the best but the better version of samp INI manager include. This include is made by me taken help from dFile include too. This is really advance INI manager and you can do almost everything you need to do with File stuff. Checkout down part for more info. about this whole e_file include. Thanks for reading.Version 1
Update: 26 June, 2013
Credits
- Excel
- dFiles Creator
Description
Natives
pawn Code:
native efile_create(location[]);
native efile_delete(location[]);
native efile_open(location[]);
native efile_close();
native efile_writestring(parameter[], value[]);
native efile_writeint(parameter[], value[]);
native efile_writebool(parameter[], bool:value);
native efile_writefloat(parameter[], Float.value);
native efile_multiset(type[],{Float,_}:...);
native efile_multiget(type[],{Float,_}:...);
native efile_readstring(parameter[]);
native efile_readint(parameter[]);
native efile_readfloat(parameter[]);
native efile_readbool(parameter[]);
native efile_movefile(location[], newlocation[]);
native efile_renamefile(location[], newname[]);
native efile_savefile();
native efile_exists(location[]);
native efile_isset(parameter[]);
native efile_unset(parameter[]);
native efile_parsestring(parameter[], value[]);
native efile_parseint(parameter[], value[]);
native efile_parsefloat(parameter[], Float:value);
native efile_parsebool(parameter[], bool:value);
PART 2: (No needed)
The part left for Version 2 is been not included in this version. If you open the script, You will see there. Those function work but still I haven't tested them so can say anything. If you think they work then please PM / Reply about them. You will get credits for that .
Not included functions:
pawn Code:
// ---------------> Not used <---------------
native efile_parsestring(parameter[], ertek[]);
native dfile_ParseInt(parameter[], ertek[]);
native dfile_ParseFloat(parameter[], Float:ertek);
native dfile_ParseBool(parameter[], bool:ertek);
Tutorial
● efile_create(location[]); Usage: Creates a new file in a specified directory.
Example:
pawn Code:
efile_create("Pot.ini");
● efile_delete(location[]);
Usage: Deletes an already existing ini file.
Example:
pawn Code:
efile_delete("Pot.ini");
● efile_open(location[]);
Usage: Opens an already existing ini file.
Example:
pawn Code:
efile_create("Pot.ini"); //I am re-creating cause i deleted it earlier.
efile_open("Pot.ini");
● efile_close();
Usage: If a file is opened, this will close it.
Example:
pawn Code:
efile_close();
● efile_writestring(parameter[], value[]);
Usage: Writes a string value to the given parameter with a value.
Example:
pawn Code:
efile_WriteString("3Dtext", "blah!");
● efile_writeint(parameter[], value);
Usage: Writes a string value to the given parameter with a value.
Example:
pawn Code:
efile_writeint("PlayerMoney", GetPlayerMoney(playerid));
● efile_writebool(parameter[], bool:value);
Usage: Writes a string value to the given parameter with a value.
Example:
pawn Code:
efile_writebool("PlayerHasHands", true);
● efile_writefloat(parameter[], Float.value);
Usage: Writes a floating value to the given parameter with a value.
Example:
pawn Code:
efile_writefloat("PlayerHealth", 11111.0); // God mode
● efile_multiset(type[],{Float,_}:...);
Usage: Writes multiple values with multiple parameters, This is an advance thing.
Example:
pawn Code:
efile_multiset("ssddfbs",
"test1", "something",
"test2", "everything",
"test3", 30,
"test4", 50,
"test5", 36.23425,
"test6", true,
"test7", "anything"
);
● efile_multiget(type[],{Float,_}:...);
Usage: Get multiple values with multiple parameters, This is an advance thing too.
Example:
pawn Code:
efile_multiset("ssddfbs",
"test1", variable1,//String
"test2", variable2,//String
"test3", variable3,//Integer
"test4", variable4,//Integer
"test5", variable5,//Float
"test6", variable6,//Bool
"test7", variable7//String
);
● efile_readstring(parameter[]);
Usage: Reads a string value from the stated parameter.
Example:
pawn Code:
efile_readstring("3Dtext");
● efile_readint(parameter[]);
Usage: Reads a integer value from the stated parameter.
Example:
pawn Code:
efile_readint("PlayerMoney");
● efile_readfloat(parameter[]);
Usage: Reads a floating value from the stated parameter.
Example:
pawn Code:
efile_readfloat("PlayerHelath");
● efile_readbool(parameter[]);
Usage: Reads a booling value from the stated parameter.
Example:
pawn Code:
efile_readbool("PlayerHasHands");
● efile_movefile(location[], newlocation[]);
Usage: Moves an existing file from given location to a new one.
Example:
pawn Code:
efile_movefile("Pot.ini", "Pot2.ini");
● efile_renamefile(location[], newname[]);
Usage: Renames an existing file from given location with a newname.
Example:
pawn Code:
efile_renamefile("Pot.ini", "BigPot.ini");
● efile_savefile();
Usage: This function is very useful, after you have writed a file, you must save it by this stock.
● efile_exists(location[]);
Usage: Checks whether the file exists or not.
Example:
pawn Code:
efile_exists("BigPot.ini");
● efile_isset(parameter[]);
Usage: Checks whether the parameter has value or not.
● efile_unset(parameter[]);
Usage: Delets the value in the parameter.
Example:
pawn Code:
efile_unset("PlayerHelath");
● efile_unset(parameter[]);
Usage: Delets the value in the parameter.
Example:
pawn Code:
efile_unset("PlayerHelath");
● efile_parsestring(parameter[], value[]);
Usage: Compares the string value from parameters against Value writen.
Example:
pawn Code:
efile_parsestring("3Dtext", "value");
● efile_parseint(parameter[], value[]);
Usage: Compares the integer value from parameters against Value writen.
● efile_parsefloat(parameter[], value[]);
Usage: Compares the floating value from parameters against Value writen.
● efile_parsebool(parameter[], value[]);
Usage: Compares the booling value from parameters against Value writen.
NOTE: This info. will help you to use Code "efile_multiset":
● "s" - string
● "d" - integer
● "b" - boolean
● "f" - float
Download
PASTEBIN
PASTEBIN