Saving error
#1

I'm facing an issue when a player is an admin(padmin >1) when he logs out and other player registers he will get the same stats, how to fix this? I am using Kush's registeration tutorial.
Reply
#2

maybe something - When player joins, in your script. It maybe as " Admin[padmin] > 1 " If so, set it to 0
Reply
#3

Could you give a link to that tutorial ? I assume that it doesn't check whether the previous player is connected or not.
Reply
#4

Quote:
Originally Posted by Jankingston
Посмотреть сообщение
maybe something - When player joins, in your script. It maybe as " Admin[padmin] > 1 " If so, set it to 0
Not.
Quote:
Originally Posted by Wizzy951
Посмотреть сообщение
Could you give a link to that tutorial ? I assume that it doesn't check whether the previous player is connected or not.
Click^^
Reply
#5

I have an idea:
pawn Код:
//add this to the enumerator
Logged
//when player logs
PlayerInfo[playerid][Logged] = 1;
//and when player logs out
PlayerInfo[playerid][Logged] = 0;
And tell me if it works.
Reply
#6

I did that before even posting this topic mate but doesn't work.

On disconnect.
On Register.
On Connect.
On RequestClass.
Reply
#7

I had this issue before, it happens because you didn't reset the variables when player first registers, which means he'll have the same variables values of the last guy who had his ID.

OnPlayerConnect, reset the enums/player variables:
pawn Код:
public OnPlayerConnect(playerid)
{
    RestartVariables(playerid);
    return 1;
}

stock RestartVariables(playerid)
{
    // reset variables to avoid random players getting your powers
    Admin[playerid] = 0.
    // etc
    return 1;
}
Reply
#8

Thank you so much man!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)