INI_LOAD issues
#1

So, I've been making my faction system, but then some stuff occured. I can't seem to load faction stats into the game.
Saving works, but as loading fails to, everything get set back to 0 when the files get saved.
My code:
pawn Код:
INI:HIT[tag](factionid, name[], value[])
{
    INI_Int("Members", FactionInfo[9][fMembers]);
    INI_String("Motto", FactionInfo[9][fMotd], 128);
    INI_Int("Bank", FactionInfo[9][fBank]);
    INI_Float("x", FactionInfo[9][fHQx]);
    INI_Float("y", FactionInfo[9][fHQy]);
    INI_Float("z", FactionInfo[9][fHQz]);
    INI_Float("intx", FactionInfo[9][fHQIntx]);
    INI_Float("inty", FactionInfo[9][fHQInty]);
    INI_Float("intz", FactionInfo[9][fHQIntz]);
    INI_Int("intInterior", FactionInfo[9][fHQInterior]);
    return 0;
}
stock LoadFactions()
{
    new file9[20];
    format(file9, sizeof(file9), "Factions/HIT.ini");
    INI_Load(file9, .bLocal = false);
}
Reply
#2

pawn Код:
INI:Factions/HIT[tag](factionid, name[], value[])
{
    INI_Int("Members", FactionInfo[9][fMembers]);
    INI_String("Motto", FactionInfo[9][fMotd], 128);
    INI_Int("Bank", FactionInfo[9][fBank]);
    INI_Float("x", FactionInfo[9][fHQx]);
    INI_Float("y", FactionInfo[9][fHQy]);
    INI_Float("z", FactionInfo[9][fHQz]);
    INI_Float("intx", FactionInfo[9][fHQIntx]);
    INI_Float("inty", FactionInfo[9][fHQInty]);
    INI_Float("intz", FactionInfo[9][fHQIntz]);
    INI_Int("intInterior", FactionInfo[9][fHQInterior]);
    return 0;
}
Tryed this, but didn't seem to work :S:S:S
Reply
#3

Why are you using format() (and an array) for a literal string..?
Reply
#4

Quote:
Originally Posted by MP2
Посмотреть сообщение
Why are you using format() (and an array) for a literal string..?
I first thought that you just had to use load_ini with a formatted string, but later on I released I didn't. Yet how do I fix the loading problem? As I can't seem to fix it.
Reply
#5

Bump(day passed), really need help :S I'm stuck.

Some more info: The factions file are at scriptfiles/Factions.
Reply
#6

why is it did u write return 0; after all that loading try changing it to return 1; not sure it will help u
and also show ur saving system
Reply
#7

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
why is it did u write return 0; after all that loading try changing it to return 1; not sure it will help u
and also show ur saving system
Saving works, yet loading doesn't.... That's the problem. and in ****** his tutorial he says that return 0 is a must.
Reply
#8

Bump
Reply
#9

Bump, please someone help me, as I'm getting annoyed right now.
Reply
#10

Bump, Also how comes no one seems to be able to fix this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)