Raised This Month: $12 Target: $400
 3% 

Read instead from .ini or .txt


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Estland
Member
Join Date: Nov 2012
Old 01-05-2015 , 07:34   Read instead from .ini or .txt
Reply With Quote #1

How can I read mapname + rating from .ini file?

Last edited by Estland; 01-31-2015 at 17:26.
Estland is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-05-2015 , 08:22   Re: Read instead from .ini or .txt
Reply With Quote #2

Code:
//Open a file, returns a handle or 0 on failure
native fopen(const filename[],const mode[]);

//Reads a line from a text file -- includes newline!
native fgets(file, buffer[], maxlength);

//Returns 1 if the file is ended, 0 otherwise
native feof(file);

//Closes a file handle
native fclose(file);

/* Checks if source contains string with case ignoring. On success function
* returns position in source, on failure returns -1. */
native containi(const source[],const string[]);

/* Returns converted string to number. */
native str_to_num(const string[]);

/* Gets parameters from text.
* Example: to split text: "^"This is^" the best year",
* call function like this: parse(text,arg1,len1,arg2,len2,arg3,len3,arg4,len4)
* and you will get: "This is", "the", "best", "year"
* Function returns number of parsed parameters. */
native parse(const text[], ... );
jimaway is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-05-2015 , 21:25   Re: Read instead from .ini or .txt
Reply With Quote #3

Or if you wish to use 1.8.3, http://amxmodx.org/api/textparse_ini
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply


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


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