Uhmm player that logs on gets my stats?
#1

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

What Admin System you're using?
Reply
#3

Are you using MySQL?
If so, did you sanitize data in onplayerconnect?
Reply
#4

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;
}
Reply
#5

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
Reply
#6

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)