March 28, 2024, 10:40:35 pm

Author Topic: Accounts Scripts  (Read 5375 times)

0 Members and 1 Guest are viewing this topic.

stormeus

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 1755
  • Country: us
  • VC:MP Developer
    • View Profile
    • GTA VICE CITY Respective owner
Re: Accounts Scripts
« Reply #15 on: November 11, 2011, 03:24:33 pm »
SQLite and INI are basically holding data in a file. However, SQLite is compressing and capable of indexing the data for a slight performance boost. The way it syncs to the database can be changed so it doesn't wait for the last action to finish querying before going to the next. (Another performance boost, but risky if a crash happens.)

PHP can read from an SQLite database as well, so you can make your own signature badges or even stats databases from it. Since reading and writing an SQLite database uses MUCH less I/O operations than having to read and write from a crapton of INIs, SQLite is naturally the better choice.

Also, SQLite is capable of performing some simple and a little complex logic. Let's say you have two INI files, one has the player's password and the ID of a property they own, and the other has info on a house they own. An example script using INIs would have to open up the file with the player's password, get the ID of a property, close the file, open the file with the info on their house, get the name of the house, close the file.

SQLite is simpler if you know it.
Code: [Select]
SELECT houses.name FROM players, houses WHERE players.houseID = houses.ID

SQLite by itself shouldn't be causing lag. SvM uses a scripted menu in the store, where you can "scroll" through the choices. However, I know that uses onPlayerKeyStateChange. Now consider five, or even ten players, mashing on their W A S D JUMP FIRE keys. Even if you check to see if they're in the store, it's a lot of logic that has to be processed. aXXo and I tried doing a similar menu for Argo; we noticed that the server would warp more as a result.
« Last Edit: November 11, 2011, 03:27:49 pm by stormeus »
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

<krystianoo> stormeus do good job
<krystianoo> with recent update
<krystianoo> if not agree; jeb yourself in head
<Avenger> yesterday you said death to stormeus
<karan> double standard krystianoo
<karan> he called him fake prophet too
<krystianoo> sure fake prophet
<krystianoo> but with recent updates real

aXXo

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • *
  • *
  • *
  • *
  • Posts: 2722
  • Country: in
    • View Profile
Re: Accounts Scripts
« Reply #16 on: November 17, 2011, 09:05:20 pm »
True dat.

Anyway, anyone hardly uses the scroll menu to buy weps.
Though it does look sexy.....but if it causes script warp, then I would recommend you to remove that feature all-together. (Or use the mod provided by stormeus).



What about Hash Tables vs SQL
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


morphine

  • Crazy Man
  • *****
  • Posts: 1908
  • Country: lt
    • View Profile
Re: Accounts Scripts
« Reply #17 on: November 17, 2011, 09:09:31 pm »
Hash tables are less organized than SQLite tables imo. That's one reason I don't like them much.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor