Register system using Y_INI makes random ppl admins
#1

How to fix that, when random ppl register he has max lv admin...
Reply
#2

Show us the code
Reply
#3

Its this https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#4

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.
Reply
#5

Test this
Reply
#6

There is no diffrents....
Reply
#7

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...
Reply
#8

Nope, i am gonna test it with your script !
Reply
#9

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!
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)