[Include] HSA - Easy and fast Saving!
#1

HSA is the probably the easiest way to store data in a file.
There is always a function for reading and for writing strings, integers and floats.
Of course, HSA has some advantages to other includes, which are provided for storing.
  • HSA is very easy to use!
  • HSA is normally faster than other includes
  • HSA secures data automatically
Here is a speed comparison of HSA to SII. In this 10 times in a row 100 entries have been written single to a file and read again.
From the values ​​of the arithmetic mean was determined.
You can see, that HSA is faster. (This chart is based on writing & reading single entries)

Functions:
  • getInt:
    pawn Код:
    getInt:"Filename"("Datasetname");

    Returns the saved integer "Datasetname" in the file "Filename".
  • getFloat:
    pawn Код:
    getFloat:"DateiName"("Datasetname");

    Returns the saved float "Datasetname" in the file "Filename".
  • getString:
    pawn Код:
    getString:"DateiName"("Datasetname");

    Returns the saved text "Datasetname" in the file "Filename".
  • setInt:
    pawn Код:
    setInt:"DateiName"("Datasetname",12356789);

    Saves the integer "12356789" in the file "Filename" under the name "Datasetname".
  • setFloat:
    pawn Код:
    setFloat:"DateiName"("Datasetname",1234.56789);

    Saves the float "1234.56789" in the file "Filename" under the name "Datasetname".
  • setString:
    pawn Код:
    setString:"DateiName"("Datasetname","Any text");

    Saves the text "Any text" in the file "Filename" under the name "Datasetname".
More features does not require the system!
Files are created automatically.

Examples:
  • Easy saving of players:
    pawn Код:
    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"));
  • Easy fraction cash system:
    pawn Код:
    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"));
When storing data was ever so simple?
Links:
Reply


Messages In This Thread
HSA - Easy and fast Saving! - by [LoD]Hauke - 23.03.2012, 17:19
Re: HSA - Easy and fast Saving! - by SpiderWalk - 23.03.2012, 17:35
Re: HSA - Easy and fast Saving! - by [LoD]Hauke - 23.03.2012, 18:33
Re: HSA - Easy and fast Saving! - by Kontrol - 23.03.2012, 20:37
Re: HSA - Easy and fast Saving! - by new121 - 23.03.2012, 20:48
Re: HSA - Easy and fast Saving! - by AMEENAMEEN - 23.03.2012, 22:05
Re: HSA - Easy and fast Saving! - by Ricop522 - 23.03.2012, 22:10
Re: HSA - Easy and fast Saving! - by kacper55331 - 23.03.2012, 22:18
Re: HSA - Easy and fast Saving! - by Kaperstone - 24.03.2012, 00:43
Re: HSA - Easy and fast Saving! - by J.K - 24.03.2012, 00:45
Re: HSA - Easy and fast Saving! - by Ballu Miaa - 24.03.2012, 01:14
Re: HSA - Easy and fast Saving! - by NeTuddMeg - 24.03.2012, 08:29
Re: HSA - Easy and fast Saving! - by Shadow_ - 24.03.2012, 09:34
Re: HSA - Easy and fast Saving! - by [LoD]Hauke - 24.03.2012, 10:09
Re: HSA - Easy and fast Saving! - by Lorenc_ - 24.03.2012, 10:31
Re: HSA - Easy and fast Saving! - by SlashPT - 24.03.2012, 10:40
Re: HSA - Easy and fast Saving! - by Niko_boy - 24.03.2012, 11:03
Re: HSA - Easy and fast Saving! - by DonWade - 24.03.2012, 11:16
Re: HSA - Easy and fast Saving! - by NeTuddMeg - 24.03.2012, 13:53
Re: HSA - Easy and fast Saving! - by TheArcher - 24.03.2012, 13:59
Re: HSA - Easy and fast Saving! - by NeTuddMeg - 24.03.2012, 16:57
Re: HSA - Easy and fast Saving! - by TheArcher - 24.03.2012, 17:26
Re: HSA - Easy and fast Saving! - by new121 - 24.03.2012, 22:11
Re: HSA - Easy and fast Saving! - by Shadow_ - 24.03.2012, 22:12
Re: HSA - Easy and fast Saving! - by Guilherme_. - 24.03.2012, 22:48
Re: HSA - Easy and fast Saving! - by [LoD]Hauke - 25.03.2012, 17:34

Forum Jump:


Users browsing this thread: 2 Guest(s)