Uhmm player that logs on gets my stats? -
Blast3r - 18.01.2013
Uhmmm hello.. I've started a server recently and now I'm having some problems, and that is that some players just get my stats, so I was wondering if any of you had that before, if so please tell me what's the problem, passwords are hashed and if you need any part of my script, say it.
Re: Uhmm player that logs on gets my stats? -
JaKe Elite - 18.01.2013
What Admin System you're using?
Re: Uhmm player that logs on gets my stats? -
AaronKillz - 18.01.2013
Are you using MySQL?
If so, did you sanitize data in onplayerconnect?
Re: Uhmm player that logs on gets my stats? -
Pizzy - 18.01.2013
If you use variables like:
pPassword, pUsername, pCash.
You must RESET all the variables on either OnPlayerConnect, or OnPlayerDisconnect (I suggest you do it under OnPlayerConnect)
E.G.
public OnPlayerConnect(playerid)
{
pCash[playerid] = 0;
pAdminLevel[playerid] = 0;
}
Re: Uhmm player that logs on gets my stats? -
Blast3r - 19.01.2013
Quote:
Originally Posted by Romel
What Admin System you're using?
|
I'm using my own samp system
About the MySql no
And Pizzy I got that one already
Re: Uhmm player that logs on gets my stats? -
Michael@Belgium - 19.01.2013
Quote:
Originally Posted by Pizzy
If you use variables like:
pPassword, pUsername, pCash.
You must RESET all the variables on either OnPlayerConnect, or OnPlayerDisconnect (I suggest you do it under OnPlayerConnect)
E.G.
public OnPlayerConnect(playerid)
{
pCash[playerid] = 0;
pAdminLevel[playerid] = 0;
}
|
Quote:
Originally Posted by Blast3r
I'm using my own samp system
About the MySql no
And Pizzy I got that one already
|
Reset the variables also when the player leaves (OnPlayerDisconnect()) - After the player stats get saved.
Re: Uhmm player that logs on gets my stats? -
Blast3r - 19.01.2013
Quote:
Originally Posted by Michael@Belgium
Reset the variables also when the player leaves (OnPlayerDisconnect()) - After the player stats get saved.
|
Код:
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_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVip]);
INI_WriteInt(File,"Warns",PlayerInfo[playerid][pWarn]);
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_Close(File);
KillStreak[playerid] = 0;
return 1;
}
Already done :/
EDIT: I fixed it, thx a lot for your help