Dini Saves "я" Symbol to .ini File
#1

Hello guys,

I have a problem with my saving system. When my character connects the server, dini adds a symbol to inside of "charactername.ini" file. Why this is happening?

Check the picture.
Reply
#2

And can i workaround it if i add "\n" to dini code which one is getting players registered?

etc:

(registering player)
dini_Create(file);
dini_IntSet(file, "\nPassword", udb_hash(inputtext));
dini_IntSet(file, "Blah blah", blahblah);
Reply
#3

First, we're not able to help u unless u show us code
also dini is too old, use some new file libraries like y_ini, faster and more advanced
But as i said earlier, show us the code
Reply
#4

OnPlayerConnect

Код:
public OnPlayerConnect(playerid)
{


	format(file, 128, "/kayit/%s.ini", GetName(playerid));
	SetPlayerWantedLevel(playerid, dini_Int(file, "yildiz"));

//DISABLE VENDING MACHINES: CODES/FILTERSCRIPT BY ASTON//

//Los Santos and Countryside
    RemoveBuildingForPlayer(playerid, 956, 1634.1487,-2238.2810,13.5077, 20.0); //Snack vender @ LS Airport
	RemoveBuildingForPlayer(playerid, 956, 2480.9885,-1958.5117,13.5831, 20.0); //Snack vender @ Sushi Shop in Willowfield
	RemoveBuildingForPlayer(playerid, 955, 1729.7935,-1944.0087,13.5682, 20.0); //Sprunk machine @ Unity Station
	RemoveBuildingForPlayer(playerid, 955, 2060.1099,-1898.4543,13.5538, 20.0); //Sprunk machine opposite Tony's Liqour in Willowfield
	RemoveBuildingForPlayer(playerid, 955, 2325.8708,-1645.9584,14.8270, 20.0); //Sprunk machine @ Ten Green Bottles
	RemoveBuildingForPlayer(playerid, 955, 1153.9130,-1460.8893,15.7969, 20.0); //Sprunk machine @ Market
	RemoveBuildingForPlayer(playerid, 955,1788.3965,-1369.2336,15.7578, 20.0); //Sprunk machine in Downtown Los Santos
	RemoveBuildingForPlayer(playerid, 955, 2352.9939,-1357.1105,24.3984, 20.0); //Sprunk machine @ Liquour shop in East Los Santos
	RemoveBuildingForPlayer(playerid, 1775, 2224.3235,-1153.0692,1025.7969, 20.0); //Sprunk machine @ Jefferson Motel
	RemoveBuildingForPlayer(playerid, 956, 2140.2566,-1161.7568,23.9922, 20.0); //Snack machine @ pick'n'go market in Jefferson
	RemoveBuildingForPlayer(playerid, 956, 2154.1199,-1015.7635,62.8840, 20.0); //Snach machine @ Carniceria El Pueblo in Las Colinas
	RemoveBuildingForPlayer(playerid, 956, 662.5665,-551.4142,16.3359, 20.0); //Snack vender at Dillimore Gas Station
	RemoveBuildingForPlayer(playerid, 955, 200.2010,-107.6401,1.5513, 20.0); //Sprunk machine @ Blueberry Safe House
	RemoveBuildingForPlayer(playerid, 956, 2271.4666,-77.2104,26.5824, 20.0); //Snack machine @ Palomino Creek Library
	RemoveBuildingForPlayer(playerid, 955, 1278.5421,372.1057,19.5547, 20.0); //Sprunk machine @ Papercuts in Montgomery
	RemoveBuildingForPlayer(playerid, 955, 1929.5527,-1772.3136,13.5469, 20.0); //Sprunk machine @ Idlewood Gas Station

	//San Fierro
	RemoveBuildingForPlayer(playerid, 1302, -2419.5835,984.4185,45.2969, 20.0); //Soda machine 1 @ Juniper Hollow Gas Station
	RemoveBuildingForPlayer(playerid, 1209, -2419.5835,984.4185,45.2969, 20.0); //Soda machine 2 @ Juniper Hollow Gas Station
	RemoveBuildingForPlayer(playerid, 956, -2229.2075,287.2937,35.3203, 20.0); //Snack vender @ King's Car Park
	RemoveBuildingForPlayer(playerid, 955, -1349.3947,493.1277,11.1953, 20.0); //Sprunk machine @ SF Aircraft Carrier
	RemoveBuildingForPlayer(playerid, 956, -1349.3947,493.1277,11.1953, 20.0); //Snack vender @ SF Aircraft Carrier
	RemoveBuildingForPlayer(playerid, 955, -1981.6029,142.7232,27.6875, 20.0); //Sprunk machine @ Cranberry Station
	RemoveBuildingForPlayer(playerid, 955, -2119.6245,-422.9411,35.5313, 20.0); //Sprunk machine 1/2 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2097.3696,-397.5220,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2068.5593,-397.5223,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2039.8802,-397.5214,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2011.1403,-397.5225,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2005.7861,-490.8688,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2034.5267,-490.8681,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2063.1875,-490.8687,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium
	RemoveBuildingForPlayer(playerid, 955, -2091.9780,-490.8684,35.5313, 20.0); //Sprunk machine 3 @ SF Stadium

	//Las Venturas
	RemoveBuildingForPlayer(playerid, 956, -1455.1298,2592.4138,55.8359, 20.0); //Snack vender @ El Quebrados GONE
	RemoveBuildingForPlayer(playerid, 955, -252.9574,2598.9048,62.8582, 20.0); //Sprunk machine @ Las Payasadas GONE
	RemoveBuildingForPlayer(playerid, 956, -252.9574,2598.9048,62.8582, 20.0); //Snack vender @ Las Payasadas GONE
	RemoveBuildingForPlayer(playerid, 956, 1398.7617,2223.3606,11.0234, 20.0); //Snack vender @ Redsands West GONE
	RemoveBuildingForPlayer(playerid, 955, -862.9229,1537.4246,22.5870, 20.0); //Sprunk machine @ The Smokin' Beef Grill in Las Barrancas GONE
	RemoveBuildingForPlayer(playerid, 955, -14.6146,1176.1738,19.5634, 20.0); //Sprunk machine @ Fort Carson GONE
	RemoveBuildingForPlayer(playerid, 956, -75.2839,1227.5978,19.7360, 20.0); //Snack vender @ Fort Carson GONE
	RemoveBuildingForPlayer(playerid, 955, 1519.3328,1055.2075,10.8203, 20.0); //Sprunk machine @ LVA Freight Department GONE
	RemoveBuildingForPlayer(playerid, 956, 1659.5096,1722.1096,10.8281, 20.0); //Snack vender near Binco @ LV Airport GONE
	RemoveBuildingForPlayer(playerid, 955, 2086.5872,2071.4958,11.0579, 20.0); //Sprunk machine @ Sex Shop on The Strip
	RemoveBuildingForPlayer(playerid, 955, 2319.9001,2532.0376,10.8203, 20.0); //Sprunk machine @ Pizza co by Julius Thruway (North)
	RemoveBuildingForPlayer(playerid, 955, 2503.2061,1244.5095,10.8203, 20.0); //Sprunk machine @ Club in the Camels Toe
	RemoveBuildingForPlayer(playerid, 956, 2845.9919,1294.2975,11.3906, 20.0); //Snack vender @ Linden Station

	//Interiors: 24/7 and Clubs
	RemoveBuildingForPlayer(playerid, 1775, 496.0843,-23.5310,1000.6797, 20.0); //Sprunk machine 1 @ Club in Camels Toe
	RemoveBuildingForPlayer(playerid, 1775, 501.1219,-2.1968,1000.6797, 20.0); //Sprunk machine 2 @ Club in Camels Toe
	RemoveBuildingForPlayer(playerid, 1776, 501.1219,-2.1968,1000.6797, 20.0); //Snack vender @ Club in Camels Toe
	RemoveBuildingForPlayer(playerid, 1775, -19.2299,-57.0460,1003.5469, 20.0); //Sprunk machine @ Roboi's type 24/7 stores
	RemoveBuildingForPlayer(playerid, 1776, -35.9012,-57.1345,1003.5469, 20.0); //Snack vender @ Roboi's type 24/7 stores
	RemoveBuildingForPlayer(playerid, 1775, -17.0036,-90.9709,1003.5469, 20.0); //Sprunk machine @ Other 24/7 stores
	RemoveBuildingForPlayer(playerid, 1776, -17.0036,-90.9709,1003.5469, 20.0); //Snach vender @ Others 24/7 stores

//DISABLE VENDING MACHINES: CODES/FILTERSCRIPT BY ASTON//


    oldumu[playerid]=0;
	format(file, 128, "/kayit/%s.ini", GetName(playerid));

	GetPlayerIp(playerid, playerIP, 16);

	TogglePlayerSpectating(playerid, 1);

	if(!dini_Exists(file))
	{
	    format(str, 128, "Hoşgeldin %s \n\nLьtfen ьye ol.", GetName(playerid));
		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Ьyelik", str, "Gцnder", "Зık");
	}
    if(dini_Exists(file))
    {
		if(strcmp(playerIP, dini_Get(file, "IP"), true) == 0)
		{
	   		dini_Set(file, "IP", playerIP);

		    SetPVarInt(playerid, "Logged", 1);

			SetPlayerCash(playerid, dini_Int(file, "Money"));
			SetPlayerScore(playerid, dini_Int(file, "Score"));
			SetPVarInt(playerid, "Kills", dini_Int(file, "Kills"));
			SetPVarInt(playerid, "Deaths", dini_Int(file, "Deaths"));
			SetPVarInt(playerid, "Time", dini_Int(file, "Minutes Ingame"));

			Update = SetTimerEx("UpdateTime", 60*1000, 1, "i", playerid);

		    SendClientMessage(playerid, colorGreen, "Girişiniz otomatik olarak yapıldı.");
		    TogglePlayerSpectating(playerid, 0);
		}
		else
		{
	    	format(str, 128, "Hoşgeldin %s \n\nLьtfen şifrenle giriş yap.", GetName(playerid));
			ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Giriş", str, "Gцnder", "Зık");
		}
	}
	return 1;
}
Reply
#5

OnGameModeInit
Код:
public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
 	DisableInteriorEnterExits();
	EnableStuntBonusForAll(0);
	ManualVehicleEngineAndLights();

	
	AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    surucukursu = CreatePickup(1239, 1, 1734.4595,-1271.1991,13.5464, -1);
    emniyet = CreatePickup(1239, 1, 1543.7047,-1675.3339,13.5570, -1);
    hastane = CreatePickup(1239, 1, 2034.4834,-1404.4559,17.2589, -1);

	AddStaticVehicle(481,1561.4028,-2334.9023,13.2160,89.0924,53,53); // bisiklet havalimanı
	AddStaticVehicle(481,1561.6641,-2338.2480,13.2161,92.2083,53,53); // bisiklet havalimanı
	AddStaticVehicle(481,1562.0806,-2331.8972,13.2188,91.0874,53,53); // bisiklet havalimanı
	AddStaticVehicle(481,1561.8319,-2328.9443,13.2185,88.3954,53,53); // bisiklet havalimanı
	AddStaticVehicle(481,1561.6813,-2325.1472,13.2184,92.0873,53,53); // bisiklet havalimanı



	format(file, 128, "/Arabalar/TC1453.ini");

    if(dini_Exists(file))
    {
	new arac1 = AddStaticVehicleEx(dini_Int(file, "model"),dini_Int(file, "aracx"),dini_Int(file, "aracy"),dini_Int(file, "aracz"),dini_Int(file, "aracr"),dini_Int(file, "renk1"),dini_Int(file, "renk2"),-1); // bisiklet havalimanı
	__SetVehicleNumberPlate(arac1, "TC1453");
	SetVehicleNumberPlate(arac1, "TC1453");
	SetVehicleHealth(arac1, dini_Int(file, "saglik"));
	UpdateVehicleDamageStatus(arac1, dini_Int(file, "hasarpanel"), dini_Int(file, "hasarkapi"), dini_Int(file, "hasarisik"), dini_Int(file, "hasarlastik"));


 	}



	format(file, 128, "/Arabalar/PD444.ini");

    if(dini_Exists(file))
    {
	new arac2 = AddStaticVehicleEx(dini_Int(file, "model"),dini_Int(file, "aracx"),dini_Int(file, "aracy"),dini_Int(file, "aracz"),dini_Int(file, "aracr"),dini_Int(file, "renk1"),dini_Int(file, "renk2"),-1); // bisiklet havalimanı
	__SetVehicleNumberPlate(arac2, "PD444");
	SetVehicleNumberPlate(arac2, "PD444");
	SetVehicleHealth(arac2, dini_Int(file, "saglik"));
	UpdateVehicleDamageStatus(arac2, dini_Int(file, "hasarpanel"), dini_Int(file, "hasarkapi"), dini_Int(file, "hasarisik"), dini_Int(file, "hasarlastik"));


	}


/////////hiz gostergesi bas////////
	TextDraws[TDSpeedClock][0] = TextDrawCreate(496.000000,400.000000,"~g~20");
 	TextDraws[TDSpeedClock][1] = TextDrawCreate(487.000000,388.000000,"~g~40");
 	TextDraws[TDSpeedClock][2] = TextDrawCreate(483.000000,375.000000,"~g~60");
 	TextDraws[TDSpeedClock][3] = TextDrawCreate(488.000000,362.000000,"~g~80");
 	TextDraws[TDSpeedClock][4] = TextDrawCreate(491.000000,349.000000,"~g~100");
 	TextDraws[TDSpeedClock][5] = TextDrawCreate(508.000000,336.500000,"~g~120");
 	TextDraws[TDSpeedClock][6] = TextDrawCreate(536.000000,332.000000,"~g~140");
 	TextDraws[TDSpeedClock][7] = TextDrawCreate(567.000000,337.000000,"~g~160");
 	TextDraws[TDSpeedClock][8] = TextDrawCreate(584.000000,348.000000,"~g~180");
 	TextDraws[TDSpeedClock][9] = TextDrawCreate(595.000000,360.000000,"~g~200");
 	TextDraws[TDSpeedClock][10] = TextDrawCreate(603.000000,374.000000,"~g~220");
 	TextDraws[TDSpeedClock][11] = TextDrawCreate(594.000000,386.000000,"~g~240");
 	TextDraws[TDSpeedClock][12] = TextDrawCreate(585.000000,399.000000,"~g~260");
 	TextDraws[TDSpeedClock][13] = TextDrawCreate(534.000000,396.000000,"~r~/ \\");
 	TextDraws[TDSpeedClock][14] = TextDrawCreate(548.000000,401.000000,".");
 	TextDrawLetterSize(TextDraws[TDSpeedClock][13], 1.059999, 2.100000);
	TextDrawLetterSize(TextDraws[TDSpeedClock][14], 0.73, -2.60);
 	for(new i; i < 15; i++)
 	{
 		TextDrawSetShadow(TextDraws[TDSpeedClock][i], 1);
 		TextDrawSetOutline(TextDraws[TDSpeedClock][i], 0);
 	}
/////////////hiz gostergesi son///////////


	return 1;
}
Reply
#6

Solved, i just give a "\n" code to start of ini files. and voila! never see that symbol again. if it come again, it cant effect my save because of "\n" code.

Moderators can delete topic or mark SOLVED.
Reply
#7

You don't show any single line, where you create a player file at all. Please show us the correct code!

Anyway in ASCII "я" is typically the last character, also the value 255 or in hexadezimal FF. Usually this issue appears, if you try to pass UNICODE characters into an ASCII write operation.
Reply
#8

How can i change ".ini" files' charset? i have non-English alphabet, some special characters. they looks weirdy in ".ini" file.

Its about .ini file or dini system?
Reply
#9

Actually you can't since "DINI" uses fwrite and fread to search for the line, where the data should be manipulated or just read data from. You can invent an own player files system, which uses UTF-8 encoding and decoding to read and write with non ASCII characters. Or simply use database systems such as SQLite or MySQL to have a work around.

Edit: If you don't want to change (I would suggest you should), you should write your code in english, to prevent these issues.
Ben her zaman benim kodları ingilizce yaziyorum.
Reply
#10

Understood, thank you : )
Yazilan TR alfabesi karakterleri Ingilizce karakterlere cevirebilecek bir FS biliyor musun?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)