dini_Int -
cruising - 03.04.2011
Hello!
The filterscrip doesnt save player info to any file (witch it should do to a dini_Int file i guess)
Any ideas whats wrong? do i need a register/login to make it work?
I have a map in scriptfiles named "OrgUsers" and there is also no file created there
Here is the saving part
pawn Код:
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(file,sizeof(file),"OrgUsers/%s.ini", Name);
if(dini_Exists(file))
{
Member[playerid] = dini_Int(file, "Member");
Leader[playerid] = dini_Int(file,"Leader");
IsInOrg[playerid] = dini_Int(file,"Status");
IsLaw[playerid] = dini_Int(file,"Law");
request[playerid] = dini_Int(file,"Request");
IsRequesting[playerid] = dini_Int(file,"Isrequesting");
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(file,sizeof(file),"OrgUsers/%s.ini", Name);
if(dini_Exists(file))
{
dini_IntSet(file, "Member", Member[playerid]);
dini_IntSet(file, "Leader", Leader[playerid]);
dini_IntSet(file, "Status", IsInOrg[playerid]);
dini_IntSet(file, "Request", request[playerid]);
dini_IntSet(file, "IsRequesting", IsRequesting[playerid]);
}
return 1;
}
And
pawn Код:
forward Save(playerid);
public Save(playerid)
{
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "OrgUsers/%s",pname);
if(dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Member", Member[playerid]);
dini_IntSet(file, "Leader", Leader[playerid]);
dini_IntSet(file, "Status", IsInOrg[playerid]);
dini_IntSet(file, "Law", IsLaw[playerid]);
dini_IntSet(file, "Gang", IsGang[playerid]);
dini_IntSet(file, "Priv", IsPriv[playerid]);
dini_IntSet(file, "Request", request[playerid]);
dini_IntSet(file, "IsRequesting", IsRequesting[playerid]);
}
return 1;
}
Re: dini_Int -
Hashski - 03.04.2011
This is loading
pawn Код:
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(file,sizeof(file),"OrgUsers/%s.ini", Name);
if(dini_Exists(file))
{
Member[playerid] = dini_Int(file, "Member");
Leader[playerid] = dini_Int(file,"Leader");
IsInOrg[playerid] = dini_Int(file,"Status");
IsLaw[playerid] = dini_Int(file,"Law");
request[playerid] = dini_Int(file,"Request");
IsRequesting[playerid] = dini_Int(file,"Isrequesting");
}
return 1;
}
NOT SAVING, YOU IZ UNDERSTAND?!
Re: dini_Int -
cruising - 03.04.2011
Quote:
Originally Posted by Hashski
This is loading
pawn Код:
public OnPlayerConnect(playerid) { GetPlayerName(playerid, Name, sizeof(Name)); format(file,sizeof(file),"OrgUsers/%s.ini", Name); if(dini_Exists(file)) { Member[playerid] = dini_Int(file, "Member"); Leader[playerid] = dini_Int(file,"Leader"); IsInOrg[playerid] = dini_Int(file,"Status"); IsLaw[playerid] = dini_Int(file,"Law"); request[playerid] = dini_Int(file,"Request"); IsRequesting[playerid] = dini_Int(file,"Isrequesting"); } return 1; }
NOT SAVING, YOU IZ UNDERSTAND?!
|
I know, just typed over wrong code,
Hmm is it bc i dont have a create file /new file creation for entering players?
Re: dini_Int -
tanush - 03.04.2011
ok braw you only do this, Make an foldder on scriptfiles called OrgUsers then under onplayerdisconnect
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(file,sizeof(file),"OrgUsers/%s.ini", Name);
if(dini_Exists(file))
{
dini_IntSet(file, "Member", Member[playerid]);
dini_IntSet(file, "Leader", Leader[playerid]);
dini_IntSet(file, "Law",Law[playerid]);
dini_IntSet(file, "Status", IsInOrg[playerid]);
dini_IntSet(file, "Request", request[playerid]);
dini_IntSet(file, "IsRequesting", IsRequesting[playerid]);
}
return 1;
}
Then when player registers
pawn Код:
dini_Create(file);
Member[playerid] = dini_Int(file, "Member");
Leader[playerid] = dini_Int(file,"Leader");
IsInOrg[playerid] = dini_Int(file,"Status");
IsLaw[playerid] = dini_Int(file,"Law");
request[playerid] = dini_Int(file,"Request");
IsRequesting[playerid] = dini_Int(file,"Isrequesting");
when player loggs in
pawn Код:
Member[playerid] = dini_Int(file, "Member");
Leader[playerid] = dini_Int(file,"Leader");
IsInOrg[playerid] = dini_Int(file,"Status");
IsLaw[playerid] = dini_Int(file,"Law");
request[playerid] = dini_Int(file,"Request");
IsRequesting[playerid] = dini_Int(file,"Isrequesting");
Re: dini_Int -
cruising - 03.04.2011
Quote:
Originally Posted by tanush
ok braw you only do this, Make an foldder on scriptfiles called OrgUsers then under onplayerdisconnect
pawn Код:
public OnPlayerDisconnect(playerid, reason) { GetPlayerName(playerid, Name, sizeof(Name)); format(file,sizeof(file),"OrgUsers/%s.ini", Name); if(dini_Exists(file)) { dini_IntSet(file, "Member", Member[playerid]); dini_IntSet(file, "Leader", Leader[playerid]); dini_IntSet(file, "Law",Law[playerid]); dini_IntSet(file, "Status", IsInOrg[playerid]); dini_IntSet(file, "Request", request[playerid]); dini_IntSet(file, "IsRequesting", IsRequesting[playerid]); } return 1; }
Then when player registers
pawn Код:
dini_Create(file); Member[playerid] = dini_Int(file, "Member"); Leader[playerid] = dini_Int(file,"Leader"); IsInOrg[playerid] = dini_Int(file,"Status"); IsLaw[playerid] = dini_Int(file,"Law"); request[playerid] = dini_Int(file,"Request"); IsRequesting[playerid] = dini_Int(file,"Isrequesting");
when player loggs in
pawn Код:
Member[playerid] = dini_Int(file, "Member"); Leader[playerid] = dini_Int(file,"Leader"); IsInOrg[playerid] = dini_Int(file,"Status"); IsLaw[playerid] = dini_Int(file,"Law"); request[playerid] = dini_Int(file,"Request"); IsRequesting[playerid] = dini_Int(file,"Isrequesting");
|
The thing is that i dont have any register/login yet
Re: dini_Int -
tanush - 03.04.2011
http://forum.sa-mp.com/showthread.ph...ht=saving+dini
Re: dini_Int -
cruising - 03.04.2011
Quote:
Originally Posted by tanush
ok braw you only do this, Make an foldder on scriptfiles called OrgUsers then under onplayerdisconnect
pawn Код:
public OnPlayerDisconnect(playerid, reason) { GetPlayerName(playerid, Name, sizeof(Name)); format(file,sizeof(file),"OrgUsers/%s.ini", Name); if(dini_Exists(file)) { dini_IntSet(file, "Member", Member[playerid]); dini_IntSet(file, "Leader", Leader[playerid]); dini_IntSet(file, "Law",Law[playerid]); dini_IntSet(file, "Status", IsInOrg[playerid]); dini_IntSet(file, "Request", request[playerid]); dini_IntSet(file, "IsRequesting", IsRequesting[playerid]); } return 1; }
Then when player registers
pawn Код:
dini_Create(file); Member[playerid] = dini_Int(file, "Member"); Leader[playerid] = dini_Int(file,"Leader"); IsInOrg[playerid] = dini_Int(file,"Status"); IsLaw[playerid] = dini_Int(file,"Law"); request[playerid] = dini_Int(file,"Request"); IsRequesting[playerid] = dini_Int(file,"Isrequesting");
when player loggs in
pawn Код:
Member[playerid] = dini_Int(file, "Member"); Leader[playerid] = dini_Int(file,"Leader"); IsInOrg[playerid] = dini_Int(file,"Status"); IsLaw[playerid] = dini_Int(file,"Law"); request[playerid] = dini_Int(file,"Request"); IsRequesting[playerid] = dini_Int(file,"Isrequesting");
|
The thing is that i need a register/login to create a unique userfile with pass in forlder OrgUsers in scriptfiles,
And the code in first topic to read from userfile when player connect or disconnect.
or am i wrong?