Read file
Hello. Can anybody show me a full example of reading file fuctions? I am not nor I ever was familiar with such things in pawn, that's why I'm starting a thread here.
I need to check if current map is located in the file ex: the current map is dunno de_dust2 the file is like: de_dust2 de_cbble de_train it is there, let the plugin work (I know how to stop it from working, I just need to see how to read a file) If anybody wants to write that I have to create .ini file for every single map and put pluginname.amxx there then no, thanks, that's not what I'm looking for. |
Re: Read file
have u a sample file?
what u will reading? string num floats? |
Re: Read file
Strings.
[sample file] de_dust2 de_cbble de_train [/sample file] |
Re: Read file
See Bot Apology in my signature for a simple example. There is also a tutorial on file reading.
|
Re: Read file
/* Reads line from file. Returns index of next line or 0 when end of file is reached. */
native read_file(const file[],line,text[],len,&txtlen); slow :( PHP Code:
native fopen(const filename[],const mode[]); //Closes a file handle native fclose(file); //Returns 1 if the file is ended, 0 otherwise native feof(file); //Reads a line from a text file -- includes newline! native fgets(file, buffer[], maxlength); fast :) PHP Code:
|
| All times are GMT -4. The time now is 14:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.