SA-MP Forums Archive
Saving error - 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: Saving error (/showthread.php?tid=475309)



Saving error - Beckett - 12.11.2013

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.


Re: Saving error - Jankingston - 12.11.2013

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


Re: Saving error - Wizzy951 - 12.11.2013

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


Re: Saving error - Beckett - 12.11.2013

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^^


Re: Saving error - Wizzy951 - 12.11.2013

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.


Re: Saving error - Beckett - 12.11.2013

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

On disconnect.
On Register.
On Connect.
On RequestClass.


Re: Saving error - Loot - 12.11.2013

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;
}



Re: Saving error - Beckett - 12.11.2013

Thank you so much man!