DINI TO Y_INI
#1

First hello,im new in ini system and i want convert some things from dini to Ini,and dont know it :S
Can you some one help me please? Thanks !!

So here is an full script,i need convert it to Y_ini :/

Код:
//Credits to Jenkings :)		
#include <a_samp>
#include <dini>

new billboard[57];
#define BILL    0xB6149996

stock PlayerName(playerid) {
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}

public OnFilterScriptInit()
{
	print("Jenkings's billboard system loaded");
	SendClientMessageToAll(BILL, "Jenkings's billboard system loaded");
	
	billboard[0] = CreateObject(4735, 1988.36, -1476.62, 24.53,   0.00, 0.00, -90.00);
	billboard[1] = CreateObject(4735, 1976.96, -1427.01, 30.78,   0.00, 0.00, -180.00);
	billboard[2] = CreateObject(4735, 1977.91, -1371.09, 37.49,   0.00, 0.00, 180.00);
	billboard[3] = CreateObject(4735, 1854.99, -1487.29, 25.92,   0.00, 0.00, 271.00);
	billboard[4] = CreateObject(4730, 1884.98, -1551.05, 30.00,   0.00, 0.00, -65.00);
	billboard[5] = CreateObject(4730, 1863.52, -1449.67, 31.67,   0.00, 0.00, 46.00);
	billboard[6] = CreateObject(4735, 1907.58, -1353.37, 26.18,   0.00, 0.00, 270.00);
	billboard[7] = CreateObject(5854, 992.54, -962.78, 60.78,   0.00, 0.00, 0.00);
	billboard[8] = CreateObject(4735, 1222.91, -1131.15, 45.46,   0.00, 0.00, 91.00);
	billboard[9] = CreateObject(4735, 1427.30, -1138.89, 34.65,   0.00, 0.00, 0.00);
	billboard[10] = CreateObject(4735, 1536.02, -1181.09, 60.45,   0.00, 0.00, -34.80);
	billboard[11] = CreateObject(4735, 1583.60, -1176.65, 56.48,   0.00, 0.00, -119.80);
	billboard[12] = CreateObject(4735, 1580.71, -886.84, 65.28,   0.00, 0.00, -233.00);
	billboard[13] = CreateObject(4730, 2001.12, -1044.83, 43.98,   0.00, 0.00, -55.00);
	billboard[14] = CreateObject(4735, 2116.18, -1103.29, 44.41,   0.00, 0.00, 30.50);
	billboard[15] = CreateObject(4735, 2697.02, -1140.35, 73.67,   0.00, 0.00, 121.00);
	billboard[16] = CreateObject(4735, 2666.34, -1140.71, 73.76,   0.00, 0.00, 60.90);
	billboard[17] = CreateObject(4735, 2594.21, -1168.98, 71.86,   0.00, 0.00, -69.00);
	billboard[18] = CreateObject(4735, 2494.99, -1319.38, 56.07,   0.00, 0.00, -124.20);
	billboard[19] = CreateObject(4735, 2494.56, -1344.05, 56.34,   0.00, 0.00, -224.00);
	billboard[20] = CreateObject(17917, 2556.51, -1441.80, 53.67,   3.14, 0.00, 2.26);
	billboard[21] = CreateObject(17917, 2556.27, -1441.78, 53.67,   3.14, 0.00, 2.26);
	billboard[22] = CreateObject(4735, 2434.70, -1406.55, 35.59,   0.00, 0.00, 161.00);
	billboard[23] = CreateObject(4735, 2772.71, -2173.76, 24.15,   0.00, 0.00, -115.00);
	billboard[24] = CreateObject(4735, 2814.58, -2149.04, 28.28,   0.00, 0.00, 1.00);
	billboard[25] = CreateObject(4735, 2236.70, -1988.10, 32.24,   0.00, 0.00, -44.40);
	billboard[26] = CreateObject(4735, 1565.37, -1722.43, 31.16,   0.00, 0.00, 95.25);
	billboard[27] = CreateObject(4735, 1353.78, -1713.57, 26.08,   0.00, 0.00, 180.37);
	billboard[28] = CreateObject(4735, 952.47, -1293.67, 25.35,   0.00, 0.00, 2.00);
	billboard[29] = CreateObject(4735, 852.87, -990.05, 49.07,   0.00, 0.00, 100.60);
	billboard[30] = CreateObject(4735, 1029.18, -939.36, 59.04,   0.00, 0.00, 56.86);
	billboard[31] = CreateObject(1268, 695.49, -1186.18, 28.58,   0.00, 0.00, 0.00);
	billboard[32] = CreateObject(1259, 702.05, -1115.11, 26.66,   3.14, 0.00, 2.01);
	billboard[33] = CreateObject(1268, 735.06, -1102.34, 27.77,   0.00, 0.00, 0.00);
	billboard[34] = CreateObject(4735, 779.15, -1066.46, 35.63,   0.00, 0.00, -145.00);
	billboard[35] = CreateObject(4735, 560.36, -1261.47, 37.08,   0.00, 0.00, -130.90);
	billboard[36] = CreateObject(4735, 326.05, -1364.76, 35.88,   0.00, 0.00, 63.30);
	billboard[37] = CreateObject(4735, 366.95, -1388.96, 32.08,   0.00, 0.00, -37.60);
	billboard[38] = CreateObject(4735, 282.39, -1469.42, 48.57,   0.00, 0.00, 47.30);
	billboard[39] = CreateObject(4735, 356.64, -1718.01, 27.34,   0.00, 0.00, 0.80);
	billboard[40] = CreateObject(4735, 598.15, -1743.93, 33.82,   0.00, 0.00, -9.90);
	billboard[41] = CreateObject(4988, 1030.99, -2074.95, 22.16,   356.86, 0.00, 3.14);
	billboard[42] = CreateObject(4988, 1031.16, -2073.88, 22.16,   356.86, 0.00, 3.14);
	billboard[43] = CreateObject(4988, 527.03, -1755.29, 30.72,   0.00, 0.00, -93.50);
	billboard[44] = CreateObject(4988, 219.99, -1434.36, 30.48,   0.00, 0.00, -170.00);
	billboard[45] = CreateObject(4988, 193.40, -1452.25, 31.04,   0.00, 0.00, -65.80);
	billboard[46] = CreateObject(4988, 559.93, -1256.20, 28.30,   0.00, 0.00, 110.00);
	billboard[47] = CreateObject(4988, 774.81, -1030.47, 43.54,   0.00, 0.00, 128.90);
	billboard[48] = CreateObject(4988, 778.83, -1029.99, 43.54,   0.00, 0.00, -65.00);
	billboard[49] = CreateObject(4988, 882.04, -973.39, 54.73,   0.00, 0.00, 142.60);
	billboard[50] = CreateObject(4988, 885.70, -971.30, 54.56,   0.00, 0.00, -52.00);
	billboard[51] = CreateObject(4735, 1751.67, -1483.48, 30.10,   0.00, 0.00, 130.50);
	billboard[52] = CreateObject(4735, 1647.62, -1795.19, 31.34,   0.00, 0.00, 62.00);
	billboard[53] = CreateObject(4988, 1577.39, -2670.09, 22.75,   0.00, 0.00, 100.00);
	billboard[54] = CreateObject(4988, 1926.74, -2682.47, 22.16,   0.00, 0.00, -80.00);
	billboard[55] = CreateObject(4988, 2029.26, -1763.11, 34.79,   0.00, 0.00, 10.00);
	billboard[56] = CreateObject(4988, 1839.61, -1836.80, 24.97,   0.00, 0.00, 10.00);
	
	for (new a = 0; a < 57; a++)
	{
		new cesta[50];
		format(cesta, sizeof(cesta), "/billboardy/%d.sav", a);
		
		
		SetObjectMaterialText(billboard[a], dini_Get(cesta, "text"), 0, OBJECT_MATERIAL_SIZE_512x128,\
		"Arial", 35, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
	}
	return 1;
}

public OnFilterScriptExit()
{
    print("Jenkings's billboard system unloaded");
    SendClientMessageToAll(BILL, "Jenkings's billboard system unloaded");
	return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/billboard", cmdtext, true, 10) == 0)
	{
	    if(GetPlayerMoney(playerid) >= 10000)
	    {
			ShowPlayerDialog(playerid, 88, DIALOG_STYLE_INPUT, "Billboard", "Vyberte text svйho billboardu", "Koupit", "Zruљit");
		}
		else{
        	SendClientMessageToAll(BILL, "Nemбљ dost peněz,billboard stojн $10 000");
		}
		return 1;
	}
	return 0;
}




public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 88)
    {
        if(!response)
        {
            SendClientMessage(playerid, BILL, "Zruљil jsi koupi billboardu");
        }
        else
        {
            for (new a = 0; a < 57; a++)
			{
			    new cesta[50];
				format(cesta, sizeof(cesta), "/billboardy/%d.sav", a);
				
				
				if(!dini_Exists(cesta))
				{
					dini_Create(cesta);
					new unixtime = gettime() + 86400;
	                dini_Set(cesta, "nick", PlayerName(playerid));
	                dini_Set(cesta, "text", inputtext);
	                dini_IntSet(cesta, "time", unixtime);
	                
	                SetObjectMaterialText(billboard[a], inputtext, 0, OBJECT_MATERIAL_SIZE_512x128,\
					"Arial", 35, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
					GivePlayerMoney(playerid, -10000);
					SendClientMessage(playerid, BILL, "Ъspěљně sis koupil billboard");
					
					break;
				}else{
					if(gettime() > dini_Int(cesta, "time"))
					{
                        new unixtime = gettime() + 86400;
		                dini_Set(cesta, "nick", PlayerName(playerid));
		                dini_Set(cesta, "text", inputtext);
		                dini_IntSet(cesta, "time", unixtime);
		                
		                SetObjectMaterialText(billboard[a], inputtext, 0, OBJECT_MATERIAL_SIZE_512x128,\
						"Arial", 35, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
						GivePlayerMoney(playerid, -10000);
						SendClientMessage(playerid, BILL, "Ъspěљně sis koupil billboard");
		                break;
					}
					else if(a == 7)
					{
                        SendClientMessage(playerid, BILL, "Ћбdnэ billboard nenн volnэ");
					}
				}
			}
        }
        return 1;
    }

	return 0;
}
Reply
#2

Oh,i love your system but this :S.. i dont know how to convert this,maybe should i put here full script?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)