05.11.2013, 03:29
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:
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
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;
}
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
