Y-Ini copying players data - 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)
+--- Thread: Y-Ini copying players data (
/showthread.php?tid=571265)
Y-Ini copying players data -
SalmaN97 - 17.04.2015
Hello i have this issue with y-ini
when i register a new player account it will automaticly copys the data from a registered account
i am using this script:\
https://sampforum.blast.hk/showthread.php?tid=273088
Re: Y-Ini copying players data -
Azula - 17.04.2015
you must reset some variable = 0; well read again the tutoriel
Re: Y-Ini copying players data -
SalmaN97 - 17.04.2015
Quote:
Originally Posted by Azula
you must reset some variable = 0; well read again the tutoriel
|
resetting scores, play time and money?
that will set everything to 0
Re: Y-Ini copying players data -
PrivatioBoni - 17.04.2015
Quote:
Originally Posted by SalmaN97
resetting scores, play time and money?
that will set everything to 0
|
No, write the data to the file as normal, then reset the variables, e.g. PlayerInfo[playerid][pAdmin] = 0; - under OnPlayerDisconnect.
Make sure the variable clearance is after the saving code.
Re: Y-Ini copying players data -
Azula - 17.04.2015
you can just see the topic
Quote:
Originally Posted by JuanStone
I see nothing about reset variables, that might be the problem, do it and perhaps already don't have more problems with this.
|
PHP код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
//..
if(fexist(Path(playerid)))
{
INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra = true, .extra = playerid)
//..
if(pInfo[playerid][Banned] == 1 || pInfo[playerid][oBanned] == 1)
{
SendClientMessage(playerid,COLOR_RED,"[INFO] Your account is currently suspended from this server");
SetTimerEx("DelayedKick", 500, false, "d", playerid);
}
else ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT, "Mickey's: Simply TDM", "This account is registered,\nplease insert your password below", "Login", "Exit");
}
else if(!fexist(Path(playerid)))
{
pInfo[playerid][Adminlevel] = 0;
pInfo[playerid][VIPlevel] = 0;
// restart all variables per player..
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Mickey's: Simply TDM","Welcome, this username is available!\nEnter a password below to register it","Register", "Exit");
}
return true;
}
//by JuanStone
Re: Y-Ini copying players data -
SalmaN97 - 17.04.2015
Quote:
Originally Posted by Azula
you can just see the topic
PHP код:
public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
//..
if(fexist(Path(playerid)))
{
INI_ParseFile(Path(playerid),"loadaccount_user", .bExtra = true, .extra = playerid)
//..
if(pInfo[playerid][Banned] == 1 || pInfo[playerid][oBanned] == 1)
{
SendClientMessage(playerid,COLOR_RED,"[INFO] Your account is currently suspended from this server");
SetTimerEx("DelayedKick", 500, false, "d", playerid);
}
else ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_INPUT, "Mickey's: Simply TDM", "This account is registered,\nplease insert your password below", "Login", "Exit");
}
else if(!fexist(Path(playerid)))
{
pInfo[playerid][Adminlevel] = 0;
pInfo[playerid][VIPlevel] = 0;
// restart all variables per player..
ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Mickey's: Simply TDM","Welcome, this username is available!\nEnter a password below to register it","Register", "Exit");
}
return true;
}
//by JuanStone
|
thank you man