else // Before that has a ' if ', checking if the file exists
{
new amount;
INI_Open(COUNTER); // I have that defined
amount = INI_Int("Count", amount);
printf(" File count.ini already exists ");
printf(" Amount of gangs on database: %d/250"); // I want to load the amount, using INI_Int...
}
C:\Documents and Settings\F e L i P e\Desktop\SAMP SERVER 0.3C\filterscripts\gangs.pwn(49) : error 029: invalid expression, assumed zero C:\Documents and Settings\F e L i P e\Desktop\SAMP SERVER 0.3C\filterscripts\gangs.pwn(49) : error 017: undefined symbol "name" C:\Documents and Settings\F e L i P e\Desktop\SAMP SERVER 0.3C\filterscripts\gangs.pwn(49) : error 001: expected token: ";", but found "return" C:\Documents and Settings\F e L i P e\Desktop\SAMP SERVER 0.3C\filterscripts\gangs.pwn(49) : fatal error 107: too many error messages on one line |
INI_Int, INI_String
Have you tried reading through the y_ini topic? It explains reading in there, and use of those functions.
https://sampforum.blast.hk/showthread.php?tid=175565 |
INI:myini[](name[], value[])
{
INI_String("a", gA);
INI_String("b", gB);
INI_String("c", gC);
return 0; // This is now required.
}
gA, gB, gC
new INI:file = INI_Open( PLAYER );
new gName[MAX_PLAYER_NAME];
new gScore;
new Float:gHealth;
INI:NAME_OF_THE_FILE[](name[], value[])
{
INI_String("NAME", gName, sizeof(gName));
INI_Int("SCORE", gScore);
INI_Float("HEALTH", gHealth);
return 0;
}
INI_Load("NAME_OF_THE_FILE.ini");
new INI:ini = INI_Open("NAME_OF_THE_FILE.ini");
INI_WriteString(ini, "NAME", "******");
INI_WriteInt(ini, "SCORE", 1337);
INI_WriteFloat(ini, "HEALTH", 100.0);
INI_Close(ini);
new gName[MAX_PLAYER_NAME];
new gScore;
new Float:gHealth;
INI:NAME_OF_THE_FILE[](name[], value[])
{
INI_String("NAME", gName, sizeof(gName));
INI_Int("SCORE", gScore);
INI_Float("HEALTH", gHealth);
return 0;
}
public OnGameModeInit()
{
new INI:ini = INI_Open("NAME_OF_THE_FILE.ini");
INI_WriteString(ini, "NAME", "******");
INI_WriteInt(ini, "SCORE", 1337);
INI_WriteFloat(ini, "HEALTH", 100.0);
INI_Close(ini);
INI_Load("NAME_OF_THE_FILE.ini");
printf("%s %d %f", gName, gScore, gHealth);
return 1;
}