My brain hurts, help with Dini PLEASE.. -
whereschris - 13.01.2010
Okay I've been working on this for 4 hours.. 4 FREAKIN HOURS..
Any help would be great.
I'm trying to make my gamemode save my money OnPlayerDissconnect.
I got my /login to load how much money is saved in the Character file.. Example cash=30000 it will load 30k when you do /login. Although when I disconnect it does not save the money and update my file.
I tryed this, and it didn't work so any help would be nice
Код:
dini_IntSet(file,"Cash", GetPlayerMoney(playerid));
Re: My brain hurts, help with Dini PLEASE.. -
Grim_ - 13.01.2010
Dide you define "file" with the correct directory of the players file?
Re: My brain hurts, help with Dini PLEASE.. -
whereschris - 13.01.2010
format(file,sizeof(file),"Accounts/%s.ini",name);
That is what I use in my /register.. I really do not know what you mean xD
The accounts save in a folder in script files named "Accounts"
Re: My brain hurts, help with Dini PLEASE.. -
Grim_ - 13.01.2010
Do you have that line under OnPlayerDisconnect aswell?
Re: My brain hurts, help with Dini PLEASE.. -
whereschris - 13.01.2010
Quote:
Originally Posted by _Xerxes_
Do you have that line under OnPlayerDisconnect aswell?
|
Yeah I did, but it didn't work so I removed everything.
If you could remake it for me it would be nice, I can't get it to work no matter What I do lol.
Re: My brain hurts, help with Dini PLEASE.. -
Grim_ - 13.01.2010
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerName(playerid, name,
sizeof(name));
format(file,
sizeof(file), "Accounts/%s.ini", name);
dini_IntSet(file, "Cash", GetPlayerMoney(playerid));
return 1;
}
Re: My brain hurts, help with Dini PLEASE.. -
whereschris - 14.01.2010
This worked Thank you so much.
I even got my kills and deaths saving using this method