advanced question
#1

okay, so say if you have something like

timesquitted or something

you would have timesquitted++;

then dini_set("quitted",++?

im confused with this

reply asap
Reply
#2

no you'd save the variable.
Reply
#3

pawn Код:
public OnPlayerDisconnect(playerid)
{
PlayerInfo[playerid][pTimesQuitted]++;
dini_IntSet(file, "TimesQuitted", PlayerInfo[playerid][pTimesQuitted]);
return 1;
}
Just a basic idea change as you like
Reply
#4

First you must have this :
pawn Код:
#define PlayerFile "/FolderName/%s.ini"
On top of your script.

To create :
pawn Код:
if(!dini_Exists(file))
{
  dini_Create(file);
}
To save :
pawn Код:
new file[126];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
dini_IntSet(file, "VarNameOrWhatever", PlayerInfo[playerid][pTimesQuitted]);
To load :
pawn Код:
new file[126];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
PlayerInfo[playerid][pTimesQuitted] = dini_Int(file, "VarNameOrWhatever");
Reply
#5

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Посмотреть сообщение
First you must have this :
pawn Код:
#define PlayerFile "/FolderName/%s.ini"
On top of your script.

To create :
pawn Код:
if(!dini_Exists(file))
{
  dini_Create(file);
}
To save :
pawn Код:
new file[126];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
dini_IntSet(file, "VarNameOrWhatever", PlayerInfo[playerid][pTimesQuitted]);
To load :
pawn Код:
new file[126];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
PlayerInfo[playerid][pTimesQuitted] = dini_Int(file, "VarNameOrWhatever");
He asked only for the times quited thing not the whole account system xD but nice script i forgot the load thing as well
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)