Another problem with Y_Ini
#1

Hello,

Here is im having problem with Y_Ini. Okay so the problem is:
Score and money wouldnt saving, after captured a zone. Even ive added a saving script like this:

pawn Код:
forward UfoCaptured(playerid);
public UfoCaptured(playerid)
{
    UnderAttack[UFO] = 0;
    Captured[playerid][UFO] = 1;
    tCheck[UFO] = gTeam[playerid];
    KillTimer(timer[playerid][UFO]);
    GangZoneStopFlashForAll(Zone[UFO]);
    GangZoneShowForAll(Zone[UFO],GetPlayerColor(playerid));
    GivePlayerMoney(playerid,5000);
    SetPlayerScore(playerid,GetPlayerScore(playerid)+5);
    SendClientMessage(playerid,-1,"Congratulation!You have captured Ufo zone!");
    SendClientMessage(playerid,-1,"[INFO]:You got $5000 and 5 score for captured zone!");
    new str[256],Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Name,sizeof(Name));
    format(str,sizeof(str),"~g~%s[%d]has captured ~r~Ufo zone for ~g~%s",Name,playerid,GetTeamName(playerid));
    [B][U][SIZE="5"]SendBoxMessage(str);
    PlayerInfo[playerid][pCapture]++;
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"Data");
    INI_WriteInt(File,"Captured Zone",PlayerInfo[playerid][pCapture]);
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Scores",GetPlayerScore(playerid));[/SIZE][/U][/B]
    foreach(new i:Player)
    {
        if(gTeam[i] == gTeam[playerid]&&i!=playerid)
        {
            GivePlayerMoney(i,1000);
            SetPlayerScore(i,GetPlayerScore(i)+1);
            SendClientMessage(i,COLOR_GREEN,"Your team has captured Ufo Zone!You got +1score and 1000$ for that");
        }
    }
    return 1;
}
Score wouldnt even writing on scriptfiles.

It is strange, because when i do: /givescore, the score is saving. Score only saving with that way (/givescore). Else, wouldnt work.

Can anyone help me with this?
thank you
Reply
#2

any?
Reply
#3

no helps?
Reply
#4

Try

pawn Код:
INI_WriteInt(File,"CapturedZone",PlayerInfo[playerid][pCapture]); //remove a space
Reply
#5

close the file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)