11.07.2015, 16:12
Quote:
i explained code with comments ... read them
Код:
enum sAcc { Announce, ReadPms, MaxPing, ReadCmds, AutoLog, sLocked, sPass[129], Chat, ReporterName[MAX_PLAYER_NAME], TargetName[MAX_PLAYER_NAME], Reason[128], Accountid, H, M, S }; new YourVariable[sAcc]; //data will store in this variable forward Load(name[], value[]); //>Loading Data function public Load(name[], value[]) { INI_Int("Announce",YourVariable[Announce]); //Loading "Announce" value into "YourVariable[Announce]" as integer INI_Int("ReadPms",YourVariable[ReadPms]); INI_Int("MaxPing",YourVariable[MaxPing]); INI_Int("ReadCmds",YourVariable[ReadCmds]); INI_Int("AutoLog",YourVariable[AutoLog]); INI_Int("sLocked",YourVariable[sLocked]); INI_String("sPass",ServerInfo[sPass], 129); INI_Int("Chat",YourVariable[Chat]); INI_String("ReporterName",ServerInfo[ReporterName], 24); INI_String("TargetName",ServerInfo[TargetName], 24); INI_String("Reason",ServerInfo[Reason], 128); INI_Int("Accountid",YourVariable[Accountid]); INI_Int("H",YourVariable[H]); INI_Int("M",YourVariable[M]); INI_Int("S",YourVariable[S]); return 1; } //>When You Want load file data into variables, Use Following Function. for example, in OnGameModeInit INI_ParseFile(/*Your File PATH Here*/, "Load", .bExtra = false, .extra = 0); //>saving variables data into file is like player data saving... //example: new INI:File = INI_Open(/*Your PATH*/); INI_SetTag(File, /*Your Tag*/); INI_WriteInt(File,"Announce",ServerInfo[YourVariable[Announce]]); //>and other things... INI_Close(File); i suggest you use MySQL to have an easier life |