Y_ini Reading
#1

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 ?
Reply
#2

Try:

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

Should help you get sorted.
Reply
#3

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.
Reply
#4

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" );"
}
Reply
#5

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 !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)