Saving - Loading
#1

Hello!
What's wrong here? The saving is working,but the loading isn't working.

PHP код:
//OnGameModeInIt
LoadTeamLimits();
//OnGameModeExit
SaveTeamLimits();
forward SaveTeamLimits();
public 
SaveTeamLimits()
{
        new 
INI:File INI_Open("Teams/TeamLimits.ini");
    
INI_WriteInt(File"SouthBoysMembers"SouthBoysM);
    
INI_WriteInt(File"YakooMembers"YakooM);
    
INI_WriteInt(File"TheTriadsMembers"TheTriadsM);
    
INI_WriteInt(File"MafiaMembers"MafiaM);
    
INI_WriteInt(File"VagosMembers"VagosM);
    
INI_WriteInt(File"CopsMembers"CopsM);
    
INI_WriteInt(File"HitmanMembers"HitmanM);
    
INI_WriteInt(File"NFSMembers"NFSM);
    
INI_WriteInt(File"MotoMembers"MotoM);
        
INI_Close(File);
        return 
1;
}
stock LoadTeamLimits(name[], value[])
{
        new 
INI:File INI_Open("Teams/TeamLimits.ini");
    
INI_Int("SouthBoysMembers",SouthBoysM);
    
INI_Int("YakooMembers",YakooM);
    
INI_Int("TheTriadsMembers"TheTriadsM);
    
INI_Int("MafiaMembers"MafiaM);
    
INI_Int("VagosMembers"VagosM);
    
INI_Int("CopsMembers"CopsM);
    
INI_Int("HitmanMembers"HitmanM);
    
INI_Int("NFSMembers"NFSM);
    
INI_Int("MotoMembers"MotoM);
    
INI_Close(File);
    return 
0;

Reply
#2

PHP код:
stock LoadTeamLimits()

        new 
INI:File INI_Open("Teams/TeamLimits.ini"); 
    
INI_Int("SouthBoysMembers",SouthBoysM); 
    
INI_Int("YakooMembers",YakooM); 
    
INI_Int("TheTriadsMembers"TheTriadsM); 
    
INI_Int("MafiaMembers"MafiaM); 
    
INI_Int("VagosMembers"VagosM); 
    
INI_Int("CopsMembers"CopsM); 
    
INI_Int("HitmanMembers"HitmanM); 
    
INI_Int("NFSMembers"NFSM); 
    
INI_Int("MotoMembers"MotoM); 
    
INI_Close(File); 
    return 
0

Reply
#3

You forgot to load in ongamemodeinit

Код:
 INI_ParseFile("Teams/TeamLimits.ini", "LoadOneFile", .bPassTag = true);
Place it in OnGameModeInit
Reply
#4

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
PHP код:
stock LoadTeamLimits()

        new 
INI:File INI_Open("Teams/TeamLimits.ini"); 
    
INI_Int("SouthBoysMembers",SouthBoysM); 
    
INI_Int("YakooMembers",YakooM); 
    
INI_Int("TheTriadsMembers"TheTriadsM); 
    
INI_Int("MafiaMembers"MafiaM); 
    
INI_Int("VagosMembers"VagosM); 
    
INI_Int("CopsMembers"CopsM); 
    
INI_Int("HitmanMembers"HitmanM); 
    
INI_Int("NFSMembers"NFSM); 
    
INI_Int("MotoMembers"MotoM); 
    
INI_Close(File); 
    return 
0

Try this and you will get "undefined symbol name and value".

CaRa,what's this? LoadOneFile
Reply
#5

Nefore opening the File you must Load it(i think that he mean that)

[QOUTE]CaRa,what's this? LoadOneFile [/QOUTE]

Don't know that it says undefined symbol sry
Reply
#6

Anyone?
Or CaRa? Can you answer? Thank you!
Reply
#7

Quote:
Originally Posted by CaRa
Посмотреть сообщение
You forgot to load in ongamemodeinit

Код:
 INI_ParseFile("Teams/TeamLimits.ini", "LoadOneFile", .bPassTag = true);
Place it in OnGameModeInit
So, with this you actually open the file, place it ongamemodeinit... Try TeamLimits.ini if doesn't work with team/teamlimits.ini
Reply
#8

I tried again something.But it isn't working.Only it saves ,loading failes,my variables are resetting to 0.

Hey!What's wrong here? It is saving but it is not loading.

PHP код:
new SouthBoysM;
new 
YakooM;
new 
TheTriadsM;
new 
MafiaM;
new 
VagosM;
new 
CopsM;
public 
OnGameModeInIt()
{
    
INI_ParseFile("Teams/TeamLimits.ini""LoadTeamLimits"falsetruetruefalse);
    return 
1;
}
public 
OnGameModeExit()
{
    
SaveTeamLimits();
    return 
1;
}
forward LoadTeamLimits(name[],value[]);
public 
LoadTeamLimits(name[],value[])
{
    if(!
strcmp(name"SouthBoysMembers"true)) { SouthBoysM strval(value); }
    if(!
strcmp(name"YakooMembers"true)) { YakooM strval(value); }
    if(!
strcmp(name"TheTriadsMembers"true)) { TheTriadsM strval(value); }
    if(!
strcmp(name"MafiaMembers"true)) { MafiaM strval(value); }
    if(!
strcmp(name"VagosMembers"true)) { VagosM strval(value); }
    if(!
strcmp(name"CopsMembers"true)) { CopsM strval(value); }
    return 
0;
}
stock SaveTeamLimits()
{
    new 
INI:File INI_Open("Teams/TeamLimits.ini");
    
INI_SetTag(File"Main");
    
INI_WriteInt(File"SouthBoysMembers"SouthBoysM);
    
INI_WriteInt(File"YakooMembers"YakooM);
    
INI_WriteInt(File"TheTriadsMembers"TheTriadsM);
    
INI_WriteInt(File"MafiaMembers"MafiaM);
    
INI_WriteInt(File"VagosMembers"VagosM);
    
INI_WriteInt(File"CopsMembers"CopsM);
    
INI_Close(File);
    return 
1;

Reply
#9

Quote:
Originally Posted by SumX
Посмотреть сообщение
I tried again something.But it isn't working.Only it saves ,loading failes,my variables are resetting to 0.

Hey!What's wrong here? It is saving but it is not loading.

PHP код:
new SouthBoysM;
new 
YakooM;
new 
TheTriadsM;
new 
MafiaM;
new 
VagosM;
new 
CopsM;
public 
OnGameModeInIt()
{
    
INI_ParseFile("Teams/TeamLimits.ini""LoadTeamLimits"falsetruetruefalse);
    return 
1;
}
public 
OnGameModeExit()
{
    
SaveTeamLimits();
    return 
1;
}
forward LoadTeamLimits(name[],value[]);
public 
LoadTeamLimits(name[],value[])
{
    if(!
strcmp(name"SouthBoysMembers"true)) { SouthBoysM strval(value); }
    if(!
strcmp(name"YakooMembers"true)) { YakooM strval(value); }
    if(!
strcmp(name"TheTriadsMembers"true)) { TheTriadsM strval(value); }
    if(!
strcmp(name"MafiaMembers"true)) { MafiaM strval(value); }
    if(!
strcmp(name"VagosMembers"true)) { VagosM strval(value); }
    if(!
strcmp(name"CopsMembers"true)) { CopsM strval(value); }
    return 
0;
}
stock SaveTeamLimits()
{
    new 
INI:File INI_Open("Teams/TeamLimits.ini");
    
INI_SetTag(File"Main");
    
INI_WriteInt(File"SouthBoysMembers"SouthBoysM);
    
INI_WriteInt(File"YakooMembers"YakooM);
    
INI_WriteInt(File"TheTriadsMembers"TheTriadsM);
    
INI_WriteInt(File"MafiaMembers"MafiaM);
    
INI_WriteInt(File"VagosMembers"VagosM);
    
INI_WriteInt(File"CopsMembers"CopsM);
    
INI_Close(File);
    return 
1;

Change your parsefile with this. You did it ?

Код:
 INI_ParseFile("Teams/TeamLimits.ini"", "LoadOneFile", .bPassTag = true);
Reply
#10

Quote:
Originally Posted by CaRa
Посмотреть сообщение
Change your parsefile with this. You did it ?

Код:
 INI_ParseFile("Teams/TeamLimits.ini"", "LoadOneFile", .bPassTag = true);
what's LoadOneFile?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)