Here is part of script but on my first PC some script save data in ini but in my second PC some script don't save data in ini
PHP код:
if(fexist(GunPath(playerid)))
{
INI_ParseFile(GunPath(playerid), "LoadGun_%s", .bExtra = true, .extra = playerid);
IsPlayersFirstSpawn{playerid} = true;
}
else
{
new File:startfile = fopen(GunPath(playerid), io_write);
fclose(startfile);
}
if(fexist(PosPath(playerid)))
{
INI_ParseFile(PosPath(playerid), "LoadPos_%s", .bExtra = true, .extra = playerid);
IsPlayersFirstSpawn{playerid} = true;
}
else
{
new File:startfile = fopen(PosPath(playerid), io_write);
fclose(startfile);
}
new bankfile[40];
format(bankfile, sizeof(bankfile), BANK_FILE, GetName(playerid));
if(fexist(bankfile))
{
INI_ParseFile(bankfile, "LoadBank_%s", .bExtra = true, .extra = playerid);
if(BankInfo[playerid][Balance] < 0)
{
BankInfo[playerid][Balance] = 0;
}
if(BankInfo[playerid][Credit] < 0)
{
BankInfo[playerid][Credit] = 0;
}
if(BankInfo[playerid][Debt] < 0)
{
BankInfo[playerid][Debt] = 0;
}
}
else
{
BankInfo[playerid][Balance] = 0;
BankInfo[playerid][Credit] = 0;
BankInfo[playerid][Debt] = 0;
BankInfo[playerid][Fees] = 0;
BankInfo[playerid][Transactions] = 0;
new bFilee[40];
format(bFilee, sizeof(bFilee), BANK_FILE, GetName(playerid));
new INI:file = INI_Open(bFilee);
INI_WriteInt(file, "Balance", BankInfo[playerid][Balance]);
INI_WriteInt(file, "Credit", BankInfo[playerid][Credit]);
INI_WriteInt(file, "Debt", BankInfo[playerid][Debt]);
INI_WriteInt(file, "Fees", BankInfo[playerid][Fees]);
INI_WriteInt(file, "Transactions", BankInfo[playerid][Transactions]);
INI_Close(file);
}
FightStyleID{playerid} = 5;
new stylefile[40];
format(stylefile, sizeof(stylefile), STYLE_FILE, GetName(playerid));
if(fexist(stylefile))
{
INI_ParseFile(stylefile, "LoadStyle_%s", .bExtra = true, .extra = playerid);
}
else
{
new INI:ffile = INI_Open(stylefile);
INI_WriteInt(ffile, "FightStyle", 0);
FightStyleID{playerid} = 0;
INI_Close(ffile);
}
new degreefile[40];
format(degreefile, sizeof(degreefile), DEGREE_FILE, GetName(playerid));
if(fexist(degreefile))
{
INI_ParseFile(degreefile, "LoadDegree_%s", .bExtra = true, .extra = playerid);
}
else
{
DegreeInfo[playerid][dReal] = 0;
DegreeInfo[playerid][dLaw] = 0;
DegreeInfo[playerid][dDefense] = 0;
DegreeInfo[playerid][dHealth] = 0;
DegreeInfo[playerid][dMechanic] = 0;
DegreeInfo[playerid][dDealer] = 0;
DegreeInfo[playerid][dWeapons] = 0;
new INI:dfile = INI_Open(degreefile);
INI_WriteInt(dfile, "dReal", DegreeInfo[playerid][dReal]);
INI_WriteInt(dfile, "dLaw", DegreeInfo[playerid][dLaw]);
INI_WriteInt(dfile, "dDefense", DegreeInfo[playerid][dDefense]);
INI_WriteInt(dfile, "dHealth", DegreeInfo[playerid][dHealth]);
INI_WriteInt(dfile, "dMechanic", DegreeInfo[playerid][dMechanic]);
INI_WriteInt(dfile, "dDealer", DegreeInfo[playerid][dDealer]);
INI_WriteInt(dfile, "dWeapons", DegreeInfo[playerid][dWeapons]);
INI_Close(dfile);
}
new userfile[40];
format(userfile, sizeof(userfile), USER_FILE, GetName(playerid));
if(fexist(userfile))
{
INI_ParseFile(userfile, "LoadUser_%s", .bExtra = true, .extra = playerid);
new check[150];
new File:checkfile = fopen(userfile, io_read);
while(fread(checkfile, check))
{
if(strcmp(check, "Banned = 1", false) == 0 || strcmp(check, "Banned=1", false) == 0)
{
format(fstr2, sizeof(fstr2), "%s [%d] беше кикнат от BG-C'n'R - Причина: Името е баннато", GetName(playerid), playerid);
SendClientMessageToAll(RED, fstr2);
Kick(playerid);
return 1;
}
else
{
format(fstr2,sizeof(fstr2),"{FFFFFF}Добре дошли %s!\n\nНапишете паролата си, за да влезете:", GetName(playerid));
ShowPlayerDialog(playerid, LOGIN_MENU, DIALOG_STYLE_PASSWORD, "{FFFFFF}BG-C'n'R Login", fstr2, "Вход", "Отказ");
}
}
}
else
{
PlayerInfo[playerid][aLevel] = 0;
PlayerInfo[playerid][vLevel] = 0;
PlayerInfo[playerid][pCash] = 10000;
PlayerInfo[playerid][pScore] = 0;
PlayerInfo[playerid][pKills] = 0;
PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pHoldups] = 0;
PlayerInfo[playerid][pCrimes] = 0;
PlayerInfo[playerid][pFined] = 0;
PlayerInfo[playerid][pArrests] = 0;
PlayerInfo[playerid][pTakedowns] = 0;
PlayerInfo[playerid][pTickets] = 0;
PlayerInfo[playerid][pRope] = 0;
PlayerInfo[playerid][pPaintCan] = 0;
PlayerInfo[playerid][pScissors] = 0;
PlayerInfo[playerid][pKits] = 0;
PlayerInfo[playerid][vLock] = 0;
PlayerInfo[playerid][Helper] = 0;
PlayerInfo[playerid][hHelper] = 0;
PlayerInfo[playerid][pWarns] = 0;
PlayerInfo[playerid][pKicks] = 0;
PlayerInfo[playerid][pJoins] = 1;
PlayerInfo[playerid][pArrests] = 0;
PlayerInfo[playerid][pMaterials] = 0;
PlayerInfo[playerid][Banned] = 0;
PlayerInfo[playerid][jTime] = 0;
PlayerInfo[playerid][pWanted] = 0;
PlayerInfo[playerid][pArmour] = 0.0;
PlayerInfo[playerid][pHealth] = 0.0;
PlayerInfo[playerid][cTime] = 0;
new INI:ufile = INI_Open(userfile);
INI_WriteInt(ufile, "aLevel",PlayerInfo[playerid][aLevel]);
INI_WriteInt(ufile, "vLevel",PlayerInfo[playerid][vLevel]);
INI_WriteInt(ufile, "pCash", PlayerInfo[playerid][pCash]);
INI_WriteInt(ufile, "pScore", PlayerInfo[playerid][pScore]);
INI_WriteInt(ufile, "pKills", PlayerInfo[playerid][pKills]);
INI_WriteInt(ufile, "pDeaths", PlayerInfo[playerid][pDeaths]);
INI_WriteInt(ufile, "pHoldups", PlayerInfo[playerid][pHoldups]);
INI_WriteInt(ufile, "pCrimes", PlayerInfo[playerid][pCrimes]);
INI_WriteInt(ufile, "pFined", PlayerInfo[playerid][pFined]);
INI_WriteInt(ufile, "pArrests", PlayerInfo[playerid][pArrests]);
INI_WriteInt(ufile, "pTakedowns", PlayerInfo[playerid][pTakedowns]);
INI_WriteInt(ufile, "pTickets", PlayerInfo[playerid][pTickets]);
INI_WriteInt(ufile, "pRope", PlayerInfo[playerid][pRope]);
INI_WriteInt(ufile, "pPaintCan", PlayerInfo[playerid][pPaintCan]);
INI_WriteInt(ufile, "pScissors", PlayerInfo[playerid][pScissors]);
INI_WriteInt(ufile, "pKits", PlayerInfo[playerid][pKits]);
INI_WriteInt(ufile, "vLock", PlayerInfo[playerid][vLock]);
INI_WriteInt(ufile, "Helper", PlayerInfo[playerid][Helper]);
INI_WriteInt(ufile, "hHelper", PlayerInfo[playerid][hHelper]);
INI_WriteInt(ufile, "pWarns", PlayerInfo[playerid][pWarns]);
INI_WriteInt(ufile, "pKicks", PlayerInfo[playerid][pKicks]);
INI_WriteInt(ufile, "pJoins", PlayerInfo[playerid][pJoins]);
INI_WriteInt(ufile, "pMaterials", PlayerInfo[playerid][pMaterials]);
INI_WriteInt(ufile, "Banned", PlayerInfo[playerid][Banned]);
INI_WriteInt(ufile, "jTime", PlayerInfo[playerid][jTime]);
INI_WriteInt(ufile, "pWanted", PlayerInfo[playerid][pWanted]);
INI_WriteFloat(ufile, "pArmour", PlayerInfo[playerid][pArmour]);
INI_WriteFloat(ufile, "pHealth", PlayerInfo[playerid][pHealth]);
INI_WriteInt(ufile, "cTime", PlayerInfo[playerid][cTime]);
INI_Close(ufile);
format(fstr,sizeof(fstr),"{FFFFFF}Добре дошли %s, в BG-Cops'n'Robbers! Вие не сте регистриран,\nнапишете паролата Ви, за да се регистрирате:", GetName(playerid));
ShowPlayerDialog(playerid, REGISTER_MENU, DIALOG_STYLE_PASSWORD, "{FFFFFF}BG-C'n'R Register", fstr, "Регистрация", "Отказ");
}
SetPlayerMapIcon(playerid, 0, 2296.2930,2461.4600,38.6875, 30, 0, MAPICON_LOCAL);//nvpd
SetPlayerMapIcon(playerid, 1, 2270.9761,2293.8179,10.8203, 52, 0, MAPICON_LOCAL);//nv city bank
SetPlayerMapIcon(playerid, 2, 2127.5869,2379.6211,10.8203, 44, 0, MAPICON_LOCAL);//isle casino
SetPlayerMapIcon(playerid, 3, 2016.9768,1916.4065,12.3424, 44, 0, MAPICON_LOCAL);//new vegas casino
SetPlayerMapIcon(playerid, 4, 2196.9570,1677.1637,12.3672, 25, 0, MAPICON_LOCAL);//caligulas casino
SetPlayerMapIcon(playerid, 5, 2019.3196,1007.7487,10.8203, 43, 0, MAPICON_LOCAL);//4 dragons casino
SetPlayerMapIcon(playerid, 6, 2159.5405,943.1776,10.8203, 6, 0, MAPICON_LOCAL);//ammu1
SetPlayerMapIcon(playerid, 7, 2367.0552,2071.0693,10.8203, 10, 0, MAPICON_LOCAL);//burger1
SetPlayerMapIcon(playerid, 9, 2393.2737,2041.5657,10.8203, 14, 0, MAPICON_LOCAL);//cluck1
SetPlayerMapIcon(playerid, 10, 2472.8655,2034.1702,11.0625, 10, 0, MAPICON_LOCAL);//burger2
SetPlayerMapIcon(playerid, 11, 2452.5308,2065.1902,10.8203, 50, 0, MAPICON_LOCAL);//24/1
SetPlayerMapIcon(playerid, 12, 2546.5271,1972.6571,10.8203, 50, 0, MAPICON_LOCAL);//24/2
SetPlayerMapIcon(playerid, 13, 2412.5039,1123.8190,10.8203, 30, 0, MAPICON_LOCAL);//cityhall
SetPlayerMapIcon(playerid, 14, 2194.9390,1990.9948,12.2969, 50, 0, MAPICON_LOCAL);//24/3
SetPlayerMapIcon(playerid, 15, 1658.4960,2250.0437,11.0701, 43, 0, MAPICON_LOCAL);//redsands casino
SetPlayerMapIcon(playerid, 16, 1607.3329,1816.7660,10.8203, 22, 0, MAPICON_LOCAL);//hospital
SetPlayerMapIcon(playerid, 17, 1672.5485,1447.8712,10.7881, 5, 0, MAPICON_LOCAL);//airport
SetPlayerMapIcon(playerid, 18, 1157.9246,2072.2874,11.0625, 10, 0, MAPICON_LOCAL);//burger3
SetPlayerMapIcon(playerid, 19, 937.0844,1733.2168,8.8516, 30, 0, MAPICON_LOCAL);//cia
SetPlayerMapIcon(playerid, 20, 776.7208,1871.4360,4.9068, 6, 0, MAPICON_LOCAL);//ammu2
SetPlayerMapIcon(playerid, 21, 173.0402,1177.1461,14.7578, 14, 0, MAPICON_LOCAL);//cluck2
SetPlayerMapIcon(playerid, 22, -316.1609,829.8887,14.2422, 6, 0, MAPICON_LOCAL);//ammu3
SetPlayerMapIcon(playerid, 23, -1508.8851,2610.7004,55.8359, 6, 0, MAPICON_LOCAL);//ammu4
SetPlayerMapIcon(playerid, 24, 2169.4143,2795.9263,10.8203, 10, 0, MAPICON_LOCAL);//burger4
SetPlayerMapIcon(playerid, 25, -1457.9816,2589.9771,55.9957, 52, 0, MAPICON_LOCAL);//el que bank
SetPlayerMapIcon(playerid, 26, -179.1975,1133.1324,19.7422, 52, 0, MAPICON_LOCAL);//fort bank
SetPlayerMapIcon(playerid, 27, -828.1474,1504.5988,19.8529, 52, 0, MAPICON_LOCAL);//los barraques bank
SetPlayerMapIcon(playerid, 28, 2351.8555,2533.6199,10.8203, 29, 0, MAPICON_LOCAL);//pizza1
SetPlayerMapIcon(playerid, 29, 2556.9512,2065.3730,11.0995, 6, 0, MAPICON_LOCAL);//ammu5
SetPlayerMapIcon(playerid, 30, 1735.7432,1866.1516,10.8203, 55, 0, MAPICON_LOCAL);//carshop
SetPlayerMapIcon(playerid, 31, 2114.8848,920.2251,10.8203, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 32, 2639.7700,1106.1627,10.8203, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 33, 2202.4160,2474.7686,10.8203, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 34, 2147.2354,2747.9351,10.8203, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 35, 1596.1118,2198.9944,10.8203, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 36, 612.0298,1695.0731,6.9922, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 37, -1328.3317,2677.4412,50.0625, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 38, -1471.3004,1864.1031,32.6328, 27, 0, MAPICON_LOCAL);//service station
SetPlayerMapIcon(playerid, 39, 2311.2742,2324.2349,10.8203, 48, 0, MAPICON_LOCAL);//night club
SetPlayerMapIcon(playerid, 40, 2319.3486,2391.8047,10.8203, 6, 0, MAPICON_LOCAL);//ammu6
SetPlayerMapIcon(playerid, 45, 2247.6702,2396.1687,10.8203, 50, 0, MAPICON_LOCAL);//24/4
SetPlayerMapIcon(playerid, 46, 1872.2554,2071.8850,11.0625, 10, 0, MAPICON_LOCAL);//burger5
SetPlayerMapIcon(playerid, 47, -1213.8292,1830.3749,41.9297, 14, 0, MAPICON_LOCAL);//cluck3
SetPlayerMapIcon(playerid, 48, 2447.6692,2376.2556,12.1635, 30, 0, MAPICON_LOCAL);//FBI HQ
SetPlayerMapIcon(playerid, 49, 1968.7693,2295.8730,16.4559, 54, 0, MAPICON_LOCAL);//NV GYM
SetPlayerMapIcon(playerid, 50, 966.2469,2160.6836,10.8203, 56, 0, MAPICON_LOCAL);//Mats pickup(LV)
SetPlayerMapIcon(playerid, 51, -2488.5205,2295.3135,4.9844, 56, 0, MAPICON_LOCAL);//Mats pickup(BS)
SetPlayerMapIcon(playerid, 52, 2375.5786,2306.3044,8.1406, 36, 0, MAPICON_LOCAL);//NVU
SetPlayerMapIcon(playerid, 53, 1976.0565,2162.1646,11.0703, 63, 0, MAPICON_LOCAL);//Paint Shop
SetPlayerMapIcon(playerid, 54, -1420.3623,2583.7390,55.8433, 63, 0, MAPICON_LOCAL);//Paint Shop
SetPlayerMapIcon(playerid, 55, -99.9229,1118.1846,19.7417, 63, 0, MAPICON_LOCAL);//Paint Shop
SetPlayerMapIcon(playerid, 56, 1602.5015,1615.4475,10.8203, 27, 0, MAPICON_LOCAL);//Airport service station
SetPlayerMapIcon(playerid, 57, -2322.4451,2298.0378,-0.5677, 27, 0, MAPICON_LOCAL);//Bayside marina service station
SetPlayerMapIcon(playerid, 58, 2305.9966,2377.8203,11.2208, 49, 0, MAPICON_LOCAL);//New Vegas Bar
SetPlayerMapIcon(playerid, 59, 2364.8955,2377.6169,10.8203, 31, 0, MAPICON_LOCAL);//New Vegas Apartments
format(fstr3, sizeof(fstr3),"[BG-C'n'R]: %s [%d] влезе в сървъра...", GetName(playerid), playerid);
SendClientMessageToAll(GREY, fstr3);
new ip[50], stringg[150];
GetPlayerIp(playerid, ip, sizeof(ip));
format(stringg, sizeof(stringg),"[BG-C'n'R]: %s [%d] - %s", GetName(playerid), playerid, ip);
SendAdminMessage(GREY, stringg);
SendClientMessage(playerid, WHITE, "BG-C'n'R >>> Здравейте в BG-C'n'R | Собственик DeadMasterBG © 2015 - 2016");
SendClientMessage(playerid, RED, "Този сървър НЕ е деадмач прочетете /rules преди да започнете да играете!");
SendClientMessage(playerid, LIGHTGREEN, "Този сървър е направен за забава...");
SendClientMessage(playerid, ORANGE, "Използвайте /help и /faqs за помощ, може да използвате /n и /askadmin за още помощ...");
GameTextForPlayer(playerid, "~n~ ~n~ ~n~ ~n~ ~w~Welcome to ~g~Bulgaria ~n~~b~Cops ~w~and ~r~Robbers!", 5000, 1);
return 1;