y_ini problem or am I doing something wrong
#1

Hello,

I am currently experiencing quite a large problem. It seems to happen both on the actual server and my localhost.

This is the code:

pawn Код:
CMD:setscore(playerid, params[])
{
    new playerb;
    if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_RED, "invalid id/name");
    if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Permissions.");
    else
    {
    new score;
    if(sscanf(params, "ui", playerb, score)) return SendClientMessage(playerid, COLOR_RED, "syntax");
    SetPlayerScore(playerb, score);
    PlayerInfo[playerb][pScore] = score;
    }
    return 1;
}
What happens is, I /setscore myself, make a NEW account and the score is on that account too. This is seriously confusing.

Any ideas?

Here is the relevant code for connecting:

pawn Код:
public OnPlayerConnect(playerid)
{

    new score = PlayerInfo[playerid][pScore];
    SetPlayerScore(playerid, score);
The saving system I use is Y_INI. Any help would be appreciated.
Reply
#2

Remove those things in player connect, and add this line in Dialog script ( of login )
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
Reply
#3

I feel incredibly silly - school boy error.

Thanks, you've fixed it. Rep will be given.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)