DataBase - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: DataBase (
/showthread.php?tid=144891)
DataBase -
Sascha - 29.04.2010
hi guys...
I got a question...my actually "database" doesn't save the money and so in it...(yea I already added such a line for it
)
So I wanted to make a new file (in a different folder) with the player's name...
So I made it create the file and wrote that at "OnPlayerConnect"
Code:
new File:dat;
new string[256], msg[256];
new nam[MAX_PLAYER_NAME], m;
GetPlayerName(playerid, nam, sizeof(nam));
format(string, sizeof(string), "%s.txd", nam);
dat = fopen(string, io_write);
m = GetPlayerMoney(playerid);
format(msg, sizeof(msg), "Money: %f\r\n", m);
fwrite(dat, msg);
fclose(dat);
But when I leave the server with some money then, it won't save it in the file...
Also I don't know how to make it read the "Money" line only as I want to store more than only the Money information in it and want the player
to give the stored datas when he/she logs in.