Register system using Y_INI makes random ppl admins -
bustern - 05.09.2013
How to fix that, when random ppl register he has max lv admin...
Re: Register system using Y_INI makes random ppl admins -
xganyx - 05.09.2013
Show us the code
Re: Register system using Y_INI makes random ppl admins -
bustern - 05.09.2013
Its this
https://sampforum.blast.hk/showthread.php?tid=273088
Re: Register system using Y_INI makes random ppl admins -
Tomer!.$ - 05.09.2013
What's the point in copying someone else's script without even learning/knowing what it does?
There's nothing wrong with copying something you already know how to do, I sometimes copy functions but only after I examine the function and see that I understand everything in the function, everything it does.
But seeing you are a beginner, you will never learn anything if you'll just blankly copy+paste scripts, without even trying to learn them.
And people won't help you in here, if you'll just post the thread of the script you copied.
Re: Register system using Y_INI makes random ppl admins -
xganyx - 05.09.2013
Test
this
Re: Register system using Y_INI makes random ppl admins -
bustern - 05.09.2013
There is no diffrents....
Re: Register system using Y_INI makes random ppl admins -
Dragonsaurus - 05.09.2013
Do you reset stats after saving them?
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_Close(File);
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pKills] = 0;
PlayerInfo[playerid][pDeaths] = 0;
return 1;
}
Edit: Get the above edited script, the previous one maybe was bugged...
Re: Register system using Y_INI makes random ppl admins -
bustern - 05.09.2013
Nope, i am gonna test it with your script !
Re: Register system using Y_INI makes random ppl admins -
ThomasEvil - 24.03.2017
Quote:
Originally Posted by Dragonsaurus
Do you reset stats after saving them?
pawn Код:
public OnPlayerDisconnect(playerid, reason) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)); INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_Close(File); PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pKills] = 0; PlayerInfo[playerid][pDeaths] = 0; return 1; }
Edit: Get the above edited script, the previous one maybe was bugged...
|
I have same problem and this is not solution. Any idea? New registered people still getting stats of last connected player... I am so crazy, cant solve it so long!
Re: Register system using Y_INI makes random ppl admins -
AndySedeyn - 24.03.2017
Quote:
Originally Posted by ThomasEvil
I have same problem and this is not solution. Any idea? New registered people still getting stats of last connected player... I am so crazy, cant solve it so long!
|
Reset the data when the player connects — before doing anything else data-related:
PHP код:
public OnPlayerConnect(playerid) {
// Reset them here ...
// Rest of your code
return 1;
}
The possibility of variables not resetting under OnPlayerDisconnect is significantly greater than when you do it under OnPlayerConnect. In fact, resetting them under OnPlayerConnect guarantees you that they will successfully reset when a player connects and remains on the server.