getInt:"Filename"("Datasetname");
getFloat:"DateiName"("Datasetname");
getString:"DateiName"("Datasetname");
setInt:"DateiName"("Datasetname",12356789);
setFloat:"DateiName"("Datasetname",1234.56789);
setString:"DateiName"("Datasetname","Any text");
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
setString:PlayerName("password","I like trains");
setInt:PlayerName("money",4125);
setFloat:PlayerName("health",74.12);
printf("the players password is %s",getString:PlayerName("password"));
printf("%s has %d$.",PlayerName,getInt:PlayerName("money"));
printf("%s has %f health.",PlayerName,getFloat:PlayerName("health"));
setInt:"fraction_money"("police",81921);
setInt:"fraction_money"("firedepartment",56121);
setInt:"fraction_money"("yakuza",1912);
setInt:"fraction_money"("lufthansa",917251);
printf("Die police has %d$",getInt:"fraction_money"("police"));
printf("Die fire department has %d$",getInt:"fraction_money"("firedepartment"));
printf("Die yakuza has %d$",getInt:"fraction_money"("yakuza"));
printf("Die lufthansa has %d$",getInt:"fraction_money"("lufthansa"));
setInt:"fraction_money"("police",81921);
setInt:"fraction_money"("firedepartment",56121);
setInt:"fraction_money"("yakuza",1912);
setInt:"fraction_money"("lufthansa",917251);
printf("Die police has %d$",getInt:"Fraktionskassen"("police"));
printf("Die fire department has %d$",getInt:"Fraktionskassen"("firedepartment"));
printf("Die yakuza has %d$",getInt:"Fraktionskassen"("yakuza"));
printf("Die lufthansa has %d$",getInt:"Fraktionskassen"("lufthansa"));
printf("the players %s password is %s",getString:PlayerName("Passwort"));
printf("the players %s password is %s",PlayerName, getString:PlayerName("Passwort"));
[09:32:17] Loading filterscript 'test.amx'... [09:32:17] SII write started [09:32:17] SII test done in 196 [09:32:17] HSA write started [09:32:18] HSA test done in 391 [09:32:18] SII read started [09:32:18] SII test done in 84 [09:32:18] this is a short string 1234567890 0.123400 [09:32:18] HSA read started [09:32:18] HSA test done in 145 [09:32:18] this is a short string 1234567890 0.123450 [09:32:18] Loaded 1 filterscripts.
#include <a_samp> #include <sii> #include <hsa> #define TEST_TIME 100 public OnFilterScriptInit() { new tick = GetTickCount(); print("SII write started"); for(new i = 0; i < TEST_TIME; i++) { INI_Open("sii.ini"); INI_WriteString("string", "this is a short string"); INI_WriteInt("int", 1234567890); INI_WriteFloat("float", 0.12345); INI_Save(); INI_Close(); } printf("SII test done in %d\n", GetTickCount() - tick); tick = GetTickCount(); print("HSA write started"); for(new i = 0; i < TEST_TIME; i++) { setString:"hsa"("string", "this is a short string"); setInt:"hsa"("int", 1234567890); setFloat:"hsa"("float", 0.12345); } printf("HSA test done in %d\n", GetTickCount() - tick); new rstring[256], rint, Float:rfloat; tick = GetTickCount(); print("SII read started"); for(new i = 0; i < TEST_TIME; i++) { INI_Open("sii.ini"); INI_ReadString(rstring, "string"); rint = INI_ReadInt("int"); rfloat = INI_ReadFloat("float"); INI_Close(); } printf("SII test done in %d\n", GetTickCount() - tick); printf("%s %d %f\n", rstring, rint, rfloat); rstring[0] = EOS; rint = 0; rfloat = 0.0; tick = GetTickCount(); print("HSA read started"); for(new i = 0; i < TEST_TIME; i++) { format(rstring, sizeof(rstring), "%s", getString:"hsa"("string")); rint = getInt:"hsa"("int"); rfloat = getFloat:"hsa"("float"); } printf("HSA test done in %d\n", GetTickCount() - tick); printf("%s %d %f\n", rstring, rint, rfloat); return 1; }
@kacper55331: Thanks! i translated a little bit too fast...
@All: this is a single entry writer. You should not loop saves, with more than 1,000 writings. because than SII is much faster. |
If your tests were made with a single entry then they are a complete fail...
If you admit that SII is much faster why did you just posted wrong tests? |