Saving question
#1

Well i got some little problem ...

The problem is saving things on GameModeExit...I got dini saving system.Now its saves and load right but i have to save a loooot of things ...so when i type
/GMX its take longer time to restart gamemode(normaly it takes 12 sec but for me takes ~25 )...How can I speedup that writing and reading files so that gmx would be faster....TNX
Reply
#2

move the data save function out of OnGameModeExit

Ive no idea what data your trying to save but here are some examples:

SavePlayerData should be ran on OnPlayerDisconnect
SaveHouseData should be saved when any variable is changed about the house ( On Command or Dialog Usually )
And on Down the list ...
Reply
#3

Eh the thing is that is not related with player , its with vehicles.....(the things about vehicles etc (lot of infrmations save))
Reply
#4

Quote:
Originally Posted by [ST
Ivex ]
Eh the thing is that is not related with player , its with vehicles.....(the things about vehicles etc (lot of infrmations save))
maybe you could post your code, so people can see and fix the mistakes/slow thingies =D?
Reply
#5

I solved it....Its a bit faster now xD...i make mistake because I used fremove on saving file so dini has to delete whole file and create it again what has slow down gmx...now I do dini_exists and if that not true only than will create file else will only update variables what is much faster....tnx all ...


Lock this...
Reply
#6

Another better method of saving data would be using the RAW system, or an alternate that caches data and then writes...

Dini uses a method of opening the file, getting/writing the result and then closing it. DJSON and SII (two other good file-writing structures/includes) open, write/read all results then close, when instructed to. Using raw is more complicated.

Just thought I'd add this in, so you'll be able to improve the speed, even though you have resolved the prime "lag issue."
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)