SA-MP Forums Archive
Y_ini Reading - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Y_ini Reading (/showthread.php?tid=311840)



Y_ini Reading - Dranais - 18.01.2012

Hello, I am trying to make a filescript that is writing into an ini files and then the gamemode will read the ini files and store it as a variable. The problem is I can't figure out how to read the ini files.
The filescript is saving it like that:

[data]
Amendes = -300

and im trying to make the gamemode to read it but I can't find how ... I've been searching and trying for over 4hours with no result .... can anyone help me please ?


Re: Y_ini Reading - Stigg - 18.01.2012

Try:

https://sampforum.blast.hk/showthread.php?tid=244223

Should help you get sorted.


Re : Re: Y_ini Reading - Dranais - 18.01.2012

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Thank you but I can't make it work ...
Here is my code:


new gAmendes;
forward Amendes_argent();
public Amendes_argent()

INI:Amendes[Amendes] (name[], value[])
{
INI_Int("Amendes", gAmendes);
INI_Load("Cordo_Russel.ini");
}

When I'm trying to compile I get these error:

D:\******\******\gamemodes\****** : error 029: invalid expression, assumed zero
D:\******\******\gamemodes\****** : warning 218: old style prototypes used with optional semicolumns
D:\******\******\gamemodes\****** : warning 209: function "@INI_Amendes_Amendes" should return a value
D:\******\******\gamemodes\******) : warning 204: symbol is assigned a value that is never used: "gAmendes"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: Y_ini Reading - Konstantinos - 18.01.2012

pawn Код:
new
    gAmendes;

forward Argent_Amendes( name[ ], value[ ] );
public Argent_Amendes( name[ ], value[ ] )
{
    INI_Int( "pAmendes", gAmendes );
    return 1;
}

main( )
{
    INI_ParseFile( "Amendas.INI", "ini_%s" );"
}



Re : Re: Y_ini Reading - Dranais - 18.01.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
pawn Код:
new
    gAmendes;

forward Argent_Amendes( name[ ], value[ ] );
public Argent_Amendes( name[ ], value[ ] )
{
    INI_Int( "pAmendes", gAmendes );
    return 1;
}

main( )
{
    INI_ParseFile( "Amendas.INI", "ini_%s" );"
}
Thank you so much !