save score problem
#1

Ok i made a login system which save score obviously and it worked no all of a sudden it doesnt save the player score and but if i edit it in the user files it will load the amount i set it to. but when i use /setscore I.G it doesnt save the score when the player disconnect, but it sets the score but doest save it when the player leave , please help me out someone.

the code i use to save the player stats when they disconnet
pawn Код:
//onplayedisconnet
    new INI:ACCOUNT = INI_Open(UserPath(playerid));
    INI_SetTag(ACCOUNT,"data");
    INI_WriteInt(ACCOUNT,"Level",pInfo[playerid][aAdmin]);
    INI_WriteInt(ACCOUNT,"Cash",GetPlayerCash(playerid));
    INI_WriteInt(ACCOUNT,"Kills",pInfo[playerid][Kills]);
    INI_WriteInt(ACCOUNT,"Deaths",pInfo[playerid][Deaths]);
    INI_WriteInt(ACCOUNT, "Banned",pInfo[playerid][Banned]);
    INI_WriteInt(ACCOUNT, "Donator",pInfo[playerid][Donator]);
    INI_WriteInt(ACCOUNT, "Score", pInfo[playerid][Score]);
    INI_WriteInt(ACCOUNT, "Skin", pInfo[playerid][Skin]);
    INI_WriteInt(ACCOUNT, "Muted",pInfo[playerid][Muted]);
    INI_Close(ACCOUNT);
And i dont think its the loaduser has the issue cause as i have stated earlier if i set it from the user file it load perfectly but if i set it in game it doesnt save when they player leaves..
Reply
#2

Then the command is the issue,show the /setscore Command.
Reply
#3

Show us the cmd /setscore
Reply
#4

You're probably using SetPlayerScore without changing pInfo[playerid][Score].
Reply
#5

I dont think this is the problem but ok:
pawn Код:
CMD:setscore(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || pInfo[playerid][aAdmin] >= 7)
    {
        new id,score;
        if(sscanf(params, "ui", id, score)) return
        SendClientMessage(playerid, red, "Usage: /Setscore <PlayerID> <New score>") ;
        if(IsPlayerConnected(id))
        {
            format(astring,sizeof(astring),"You have set %s's score to '%d'", GetName(id), score);
            SendClientMessage(playerid,blue,astring);
            format(astring, sizeof(astring), "An Administrator has set your Score to '%d'",score);
            SendClientMessage(id,yellow,astring);
            CommandToAdmins(playerid,"setscore");
            return SetPlayerScore(id, score);
        }
        else return ShowMessage(playerid, red, 2);
    }
    else return ShowMessage(playerid, red, 1);
}
Reply
#6

RESOLVED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)