Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock INI_Create(const filename[])
- {
- new File:h;
- h=fopen(filename,io_write);
- if (h) {
- fclose(h);
- return true;
- }
- return false;
- }
- //
- stock bool:INI_ReadBool(const key[])
- {
- new dest[11];
- if (INI_ReadString(dest, key)) return bool:strval(dest);
- return false;
- }
- //
- stock INI_IsSet(const key[]) {
- if ((!gFile[E_OPEN]) || (!key[0])) return false;
- new ln = -1;
- while (((ln + 1) < INI_MAX_LINES) && (gCache[ln + 1][E_VALUE][0]))
- {
- ln ++;
- if (gCache[ln][E_VALUE][0] == ';') continue;
- if (!strcmp(gCache[ln][E_KEY], key, false))
- {
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement