Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kewun on Jul 15, 2016, 10:34 AM

Title: error with ini saving stats
Post by: Kewun on Jul 15, 2016, 10:34 AM
SO, im trying to make a account system of Unique ID using the ini parser.
main problem is, that after a kill, im giving the killer +1 score and using SaveAccount ( killer )
function SaveAccount(player)
{
WriteIniInteger( "data/"+player.UniqueID+".ini", "acc", "score", player.Score)
}
There is a error that cannot open file data/ player uid.ini   in the server.exe
Screenshot:

http://imgur.com/btRouh9

i dont know how to fix :(

Title: Re: error with ini saving stats
Post by: Finch Real on Jul 15, 2016, 10:46 AM
Have you loaded ini plugin? And do you have uid.ini file?
Title: Re: error with ini saving stats
Post by: Kewun on Jul 15, 2016, 10:47 AM
ini plugin is loaded, i dont have uid ini file and idk how to create
Title: Re: error with ini saving stats
Post by: KingOfVC on Jul 15, 2016, 10:50 AM
ini plugin wont automatic create .ini file, you must create it manually
Title: Re: error with ini saving stats
Post by: Kewun on Jul 15, 2016, 10:51 AM
but how? if i use function file("blabla","w") on onPlayerJoin It will rewite it
Title: Re: error with ini saving stats
Post by: Finch Real on Jul 15, 2016, 11:20 AM
No Open notepad add somethig inside it save it as uid.ini
Title: Re: error with ini saving stats
Post by: Kewun on Jul 15, 2016, 11:22 AM
but man, i want make it working for all players, not just me :c its like account system, i dont want everytime create files manually
Title: Re: error with ini saving stats
Post by: Finch Real on Jul 15, 2016, 11:24 AM
Wt* you have to create it once Then data willbe automatically inserted in hat with the code
Title: Re: error with ini saving stats
Post by: DizzasTeR on Jul 15, 2016, 12:38 PM
Well you have to create the file manually through scripts @Kewun through squirrel's very own file functions since ini plugin doesn't create the file if its not there.
Title: Re: error with ini saving stats
Post by: KAKAN on Jul 15, 2016, 12:53 PM
OldIni  <- WriteIni;
function WriteIni( .../* The params*/ )
{
file(filename,"a+").close();
OldIni( ... );
}
Just to get an idea :)
Title: Re: error with ini saving stats
Post by: Kewun on Jul 15, 2016, 01:04 PM
Quote from: Doom_Kill3R on Jul 15, 2016, 12:38 PMWell you have to create the file manually through scripts @Kewun through squirrel's very own file functions since ini plugin doesn't create the file if its not there.
aaaaaaaaaah


now i know, i have to create a Accounts.ini, then put the player names, stats there right?
Title: Re: error with ini saving stats
Post by: Kewun on Jul 15, 2016, 06:12 PM
ok, done, fixed.
thank you all