print("SetServerData called");
new INI:file = INI_Open(#SERVER_DATA_FILE_NAME ".ini");
print("File opened");
INI_SetTag(file, "Misc");
print("Tag set");
INI_WriteInt(file, GetServerElementName(key), value);
print("Int written");
INI_Close(file);
[16:31:56] SetServerData called [16:31:56] File opened [16:31:56] Tag set [16:31:56] [debug] Run time error 6: "Invalid instruction" [16:31:56] [debug] Unknown opcode 0x103f3c6 at address 0x00000031 [16:31:56] [debug] AMX backtrace: [16:31:56] [debug] #0 00000031 in ?? () at F:\AAAA\server\pawno\include\float.inc:108 [16:31:56] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe [16:31:56] [debug] #2 00003274 in Command_Add () at F:\AAAA\server\pawno\include\YSI\y_iterate.inc:791 [16:31:56] [debug] #3 00001e94 in Command_Add () at F:\AAAA\server\pawno\include\YSI\internal\..\y_scriptinit.inc:171
"LastJobXpWipeTimestamp" |
Is that a string or a variable?
If it's a string, you should be using INI_WriteString. |
GetServerElementName(E_SERVER_DATA: element)
{
new str[32];
switch(element)
{
case OnlineRecord: str = "OnlineRecord";
case LastJobXpWipeTimestamp:str = "LastJobXpWipeTimestamp";
}
return str;
}
[01:25:45] [debug] AMX backtrace:
[01:25:45] [debug] #0 00000031 in INI_AddToBuffer (INI:file=53, name[]=@00000000 "", data[]=@0141d7f4 "0000001418513145") at <unknown file>:0
[01:25:45] [debug] #1 000a53d0 in ?? (... <13 arguments>) at F:\AAAA\server\pawno\include\YSI\internal\..\y_ini.inc:1076
[01:25:45] [debug] #2 00000031 in public TimedTasks () at <unknown file>:0
SetServerData(LastJobXpWipeTimestamp, 454);
SetServerData(LastJobXpWipeTimestamp, gettime());
new INI:file = INI_Open("Lol.txt");
INI_WriteInt(file, "Key",gettime());
INI_Close(file);
[17:31:26] [debug] Run time error 4: "Array index out of bounds"
[17:31:26] [debug] Accessing element at index 21092424 past array upper bound 499
[17:31:26] [debug] AMX backtrace:
[17:31:26] [debug] #0 0001ccb8 in ?? () from server.amx
[17:31:26] [debug] #1 000962cc in public Itter_OnGameModeInit () from server.amx
[17:31:26] [debug] #2 native CallLocalFunction () [00472ad0] from samp-server.exe
[17:31:26] [debug] #3 00002de8 in ?? () from server.amx
[17:31:26] [debug] #4 00001d6c in public OnGameModeInit () from server.amx
#define MAX_VARS 500
new Variable[MAX_VARS];
public OnGameModeInit()
{
Variable[gettime()] = 1;
return 1;
}