-
-
Save Misiur/0fe1989a16fe82de2034d766b0960015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <a_samp> | |
#define _inc_a_samp | |
#include <YSI\y_ini> | |
enum E_TEST | |
{ | |
E_TEST_INT, | |
E_TEST_STRING[24] | |
} | |
static Test[1][E_TEST]; | |
main () { | |
} | |
public OnGameModeInit() | |
{ | |
strcpy(Test[0][E_TEST_STRING], "Hello world", 24); | |
Test[0][E_TEST_INT] = 666; | |
printf("%s %d", Test[0][E_TEST_STRING], Test[0][E_TEST_INT]); | |
SaveTest(); | |
strcpy(Test[0][E_TEST_STRING], "Howdy", 24); | |
Test[0][E_TEST_INT] = 13; | |
printf("%s %d", Test[0][E_TEST_STRING], Test[0][E_TEST_INT]); | |
INI_ParseFile("test.ini", "LoadTest"); | |
printf("%s %d", Test[0][E_TEST_STRING], Test[0][E_TEST_INT]); | |
return 1; | |
} | |
forward LoadTest(name[], value[]); | |
public LoadTest(name[], value[]) { | |
INI_String("foobar", Test[0][E_TEST_STRING], 24); | |
INI_Int("bar", Test[0][E_TEST_INT]); | |
return 1; | |
} | |
SaveTest() { | |
new INI:dFile = INI_Open("test.ini"); | |
INI_WriteString(dFile, "foobar", Test[0][E_TEST_STRING]); | |
INI_WriteInt(dFile, "bar", Test[0][E_TEST_INT]); | |
INI_Close(dFile); | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment