30.07.2011, 13:18
(
Последний раз редактировалось Runedog48; 30.07.2011 в 14:11.
)
I'm trying to create a system to save stats and stuff but it won't work. It does absolutely nothing.
On player connect
On player disconnect
INI shit
Copy of player stats
On player connect
pawn Код:
new stringy[254];
format(stringy, sizeof(stringy), "Accounts\%s.ini", pname);
INI_ParseFile(stringy, "load_user_data_playerinfo_%s", .bExtra = true, .extra = playerid);
PlayerInfo[playerid][adminlvl] = lv;
GivePlayerMoney(playerid, mn);
SetPlayerScore(playerid, sc);
pawn Код:
new stringy[254];
format(stringy, sizeof(stringy), "%s.ini", pname);
new
INI:ini = INI_Open(stringy);
//INI_SetTag("playerinfo");
INI_WriteString(ini, "NAME", pname);
INI_WriteInt(ini, "MONEY", GetPlayerMoney(playerid));
INI_WriteInt(ini, "SCORE", GetPlayerScore(playerid));
INI_WriteInt(ini, "ADMINLVL", PlayerInfo[playerid][adminlvl]);
INI_Close(ini);
pawn Код:
public load_user_data(playerid, name[], value[])
{
INI_Int("MONEY", mn);
INI_Int("SCORE", sc);
INI_Int("ADMINLVL", lv);
return 1;
}
Код:
NAME = Runedog48 MONEY = 100 SCORE = 3 ADMINLVL = 5