Jump to content

×[مساعدة]× اضافة علي كود صف !


Recommended Posts

ألـــســلام عـلـيــــــكــــــم ,,, 
كــيـف ألحـال؟

شباب احتاج مساعدة
هذا مود السيارات أف3 
Veliche system F3

بعد ان تدخل الماركر يطلع قائمة داخل هذة القائمة
اسم السيارات وسعرها و يطلع شكل السيارة
صورة توضحية :

p_354tc7nk1.jpg

انا اريد اضيف علي هذة القائمة شي جديد !

بالقائمة يظهر
Vehicle   $
Nebula   1819800
Solar      1815300 
,,,إلخخخ
اريد اضيف هذا
Vehicle   $             name         
Nebula   1819800  فراري
Solar      1815300  بي ام دبيو
,,,وإلخخخ
*(  انت بعد تدخل بالماركر يطلع لك قائمة مكتوب اسم سيارة وسعرها وتشوف السيارة أريد اسوي إضافة اسم سيارة بالعربي انا احط الأسماء وهو يطلعها

انا أريد اسوي إضافة يطلع اسم سيارة بس بالعربي فراري بي ام انا احط لة اسم كل سيارة بالعربي وهو يطلع والخخخ )*


ألكـود::-

 

setTimer ( function ()

local theCol = getElementData(root, "BlockExportCol")
	
function isInColExport ()
	if isElement(theCol) and isElementWithinColShape(localPlayer,theCol) then
		return true else return false
	end
end

function ClientExplosionCFunction()
 if isInColExport ()  then
  cancelEvent ()
 end
end
addEventHandler("onClientExplosion", root, ClientExplosionCFunction)

end , 1000, 1 )

local screX, screY = guiGetScreenSize()
 
Window_VS = guiCreateWindow(screX/2-200,screY/2-175,400,350,"...::: Vehicle System < لـوحة ألتـحـكـم بآلـسـيـارات :::...",false)
guiSetAlpha(Window_VS, 0.88)
guiWindowSetSizable(Window_VS, false)
guiSetVisible(Window_VS, false)
Grid_VS = guiCreateGridList(8,42,380,125,false,Window_VS)
guiGridListSetSelectionMode(Grid_VS, 1)
guiGridListAddColumn(Grid_VS,"Vehicle",0.38)
guiGridListAddColumn(Grid_VS,"Price $",0.3)
guiGridListAddColumn(Grid_VS,"Health",0.2)
Label_VeS = guiCreateLabel(8,22,80,50,"Your Vehicle:",false,Window_VS)
Label_VeS = guiCreateLabel(250,22,200,50,"السيآرات ألـخـآص بيـكـ :",false,Window_VS)
Label_SVS = guiCreateLabel(150,170,189,15,"Vehicle Options:",false,Window_VS)
guiLabelSetColor(Label_VeS, 255, 125, 0)
guiLabelSetColor(Label_SVS, 255, 125, 0)
guiSetFont(Label_VeS, "default-bold-small")
guiSetFont(Label_SVS, "default-bold-small")

Button_VS_sn = guiCreateButton(8,200,188,23,"أظهار السيارة",false,Window_VS)guiSetProperty(Button_VS_sn, "NormalTextColour", "FF15EE0A")
Button_VS_dy = guiCreateButton(205,200,188,23,"إخـفاء السيارة",false,Window_VS)guiSetProperty(Button_VS_dy, "NormalTextColour", "FF0CE4F2")

Button_VS_lk = guiCreateButton(8,230,188,23,"إغـلاق/فتح ألسيارة",false,Window_VS)guiSetProperty(Button_VS_lk, "NormalTextColour", "FFF4089E")
Button_VS_lt = guiCreateButton(205,230,188,23,"تشغيل/إطفاء الأضواء",false,Window_VS)guiSetProperty(Button_VS_lt, "NormalTextColour", "FFCFBE2A")

Button_VS_bp = guiCreateButton(8,260,188,23,"وضع علامة علي سيارة",false,Window_VS)guiSetProperty(Button_VS_bp, "NormalTextColour", "FFF50202")

Button_VS_Fix = guiCreateButton(8,290,188,23,"أصـلآح ألسيارة",false,Window_VS)guiSetProperty(Button_VS_Fix, "NormalTextColour", "FF09EC09")
--guiSetProperty(Button_VS_Fix, "Disabled", "True")
Button_VS_Warp = guiCreateButton(205,290,188,23,"أظهآر السيارة بجانبك*(5,000)*",false,Window_VS)guiSetProperty(Button_VS_Warp, "NormalTextColour", "FF1462D6")

Button_VS_sl = guiCreateButton(8,320,188,23,"بيع ألسيارة",false,Window_VS)guiSetProperty(Button_VS_sl, "NormalTextColour", "FF37B179")

Button_VS_close = guiCreateButton(205,320,188,23,"إغـلاق",false,Window_VS)guiSetProperty(Button_VS_close, "NormalTextColour", "FFC7CD1A")

Window_CHK = guiCreateWindow(screX/2-155,screY/2-60,310,120,"!!! WARNING !!!",false)
guiSetVisible(Window_CHK, false)
guiSetProperty(Window_CHK, "AlwaysOnTop", "true")
guiWindowSetSizable(Window_CHK, false)
Label_CHK = guiCreateLabel(21,28,266,36,"",false,Window_CHK)
guiLabelSetColor(Label_CHK, 255, 255, 0)
guiLabelSetHorizontalAlign(Label_CHK,"center",true)
Button_CHK_Y = guiCreateButton(17,73,129,36,"Yes",false,Window_CHK)
Button_CHK_N = guiCreateButton(161,73,129,36,"No",false,Window_CHK)

function updateGridList()
	local data = getElementData(localPlayer, "VehicleInfo")
	if data then
		local rw, cl = guiGridListGetSelectedItem(Grid_VS)
		guiGridListClear(Grid_VS)
		for i, data in ipairs (data) do
			local carName = getVehicleNameFromModel(data["Model"])
			local ID = data["ID"]
			local Cost = data["Cost"]
			local HP = math.floor(data["HP"])
			local PreCost = math.ceil(Cost*.9*HP/100/10)
			local row = guiGridListAddRow(Grid_VS)
			guiGridListSetItemText(Grid_VS, row, 1, carName, false, true)
			guiGridListSetItemData(Grid_VS, row, 1, ID)
			guiGridListSetItemText(Grid_VS, row, 2, PreCost, false, true)
			guiGridListSetItemText(Grid_VS, row, 3, HP.." %", false, true)
		end
		guiGridListSetSelectedItem(Grid_VS, rw, cl)
	end
end

outputChatBox("   xXx ~ Press F3 For >Vehicle System< لشـراء سيآرات أضـغـط أف3 ~ xXx", 255, 125, 0)

bindKey("F3", "down",
function()
if getElementInterior(localPlayer) == 0 and getElementDimension(localPlayer) == 0 then
if getElementData(localPlayer, "MissionWarProtection") and getElementData(localPlayer, "MissionProtection")then return end
    guiSetVisible(Window_VS, not guiGetVisible(Window_VS))
	guiSetVisible (Window_CHK, false)
	showCursor(guiGetVisible(Window_VS))
	end
end)


triggerServerEvent("onOpenGui", localPlayer)

addEventHandler("onClientElementDataChange", root,
function(dd)
	if getElementType(source) == "player" and source == localPlayer and dd == "VehicleInfo" then
		local data = getElementData(source, dd)
		if data then
			updateGridList()
		end
	end
end)

function WINDOW_CLICK_VEHICLE (button, state, absoluteX, absoluteY)
	local id = guiGridListGetSelectedItem(Grid_VS)
	local ID = guiGridListGetItemData(Grid_VS, id, 1)
	if source == Button_VS_close then
		guiSetVisible(Window_VS, false)
		showCursor(false)
	end
	if (source == Grid_VS) then
		if id == -1 and idd then
			guiGridListSetSelectedItem(Grid_VS, idd, 1)
			return false
		else
			idd = guiGridListGetSelectedItem(Grid_VS)
		end
	elseif id == -1 then
	elseif (source == Button_VS_sn) then
	if not isInColExport () then
		triggerServerEvent("SpawnMyVehicle", localPlayer, ID)
                end
	elseif (source == Button_VS_dy) then 
		triggerServerEvent("DestroyMyVehicle", localPlayer, ID)
	elseif (source == Button_VS_lt) then 
		triggerServerEvent("LightsMyVehicle", localPlayer, ID)
	elseif (source == Button_VS_bp) then 
		triggerServerEvent("BlipMyVehicle", localPlayer, ID)
	elseif (source == Button_VS_lk) then 
		triggerServerEvent("LockMyVehicle", localPlayer, ID)
	elseif (source == Button_VS_sl) then 
		guiSetVisible(Window_CHK, true)
		local carName = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 1)
		local carprice = guiGridListGetItemText(Grid_VS, guiGridListGetSelectedItem(Grid_VS), 2)
		guiSetText(Label_CHK, 'Are you sure you want to sell this Vehicle "'..carName..'" for $'..carprice)
	elseif source == Button_CHK_Y then
		triggerServerEvent("SellMyVehicle", localPlayer, ID)
		guiSetVisible(Window_VS, false)
		guiSetVisible(Window_CHK, false)
		showCursor(false)
	elseif source == Button_CHK_N then
		guiSetVisible (Window_CHK, false)
	elseif source == Button_VS_Spc then
      if getElementInterior(localPlayer) == 0 then
if getElementData(localPlayer,"Stats") < 2 then
		SpecVehicle(ID)
end
end
	elseif source == Button_VS_Fix then
		triggerServerEvent("FixMyVehicle", localPlayer, ID)
	elseif source == Button_VS_Warp then
	       if not isInColExport () then
		triggerServerEvent("WarpMyVehicle", localPlayer, ID)
                      end
	end
end
addEventHandler("onClientGUIClick", resourceRoot, WINDOW_CLICK_VEHICLE)

function SpecVehicle(id)

	if spc then 
		removeEventHandler("onClientPreRender", root, Sp)
		setCameraTarget(localPlayer)
		if isTimer(freezTimer) then killTimer(freezTimer) end
		freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1)
		spc = false
	return end
	for i, vehicle in ipairs(getElementsByType("vehicle")) do
		if getElementData(vehicle, "Owner") == localPlayer and getElementData(vehicle, "ID") == id then
			cVeh = vehicle
			spc = true
			addEventHandler("onClientPreRender", root, Sp)
			guiSetVisible(Window_VS, false)
			showCursor(false)
			break
		  end
                        
	end
end

function Sp()
	if isElement(cVeh) then
		local x, y, z = getElementPosition(cVeh)
		setElementFrozen(localPlayer, true)
		setCameraMatrix(x, y-1, z+15, x, y, z)

	else
		removeEventHandler("onClientPreRender", root, Sp)
		setCameraTarget(localPlayer)
		if isTimer(freezTimer) then killTimer(freezTimer) end
		freezTimer = setTimer(function() setElementFrozen(localPlayer, false) end, 2500, 1)
		spc = false
      end
end

ShopMarkersTable = {}	

local ShopTable = {
	[1] = {ID = {{491, 1441400}
		,{540, 1436800}
		,{401, 1430000}
		,{546, 1527700}
		,{505, 1414000}
		,{500, 1402600}
		,{463, 1659300}
		,{492, 1459300}
		,{547, 1429600}
		,{586, 1629600}
		,{467, 1354300}
		,{479, 1244800}
		,{404, 1059900}
		,{410, 946200}
		,{471, 593600}
		,{418, 300000}
		}, vPosX = 2134, vPosY = -1170, vPosZ = 28.15, PosX = 2133, PosY = -1149, PosZ = 23.4, CamX = 2134.1, CamY = -1160, CamZ = 35, lookAtX = 2133.3, lookAtY = -1168, lookAtZ = 28},
	[2] = {ID = {{516, 1819800,'Ss'}
		,{458, 1815300}
		,{580, 1801600}
		,{421, 1801600}
		,{527, 1667300}
		,{581, 2151400}
		,{409, 1744500}
		,{585, 1696600}
		,{474, 1573800}
		,{419, 1539500}
		,{436, 1539500}
		,{545, 1530400}
		,{466, 1616700}
		,{529, 1580200}
		,{550, 1473400}
		,{468, 1966500}
		}, vPosX = 552, vPosY = -1288, vPosZ = 18, PosX = 562, PosY = -1270, PosZ = 16, CamX = 552, CamY = -1275.82, CamZ = 21.61, lookAtX = 552, lookAtY = -1276.77, lookAtZ = 21.29},
	[3] = {ID = {{533, 1973100}
		,{555, 1943400}
		,{507, 2041200}
		,{521, 2427500}
		,{461, 2427500}
		,{566, 1995500}
		,{551, 1972700}
		,{400, 1970400}
		,{558, 1863600}
		,{549, 1824800}
		,{579, 1902000}
		,{576, 1797400}
		,{526, 1781400}
		,{517, 1772300}
		,{575, 1763200}
		,{561, 1822100}
		}, vPosX = 1942.5, vPosY = 2052, vPosZ = 11, PosX = 1946, PosY = 2068, PosZ = 10, CamX = 1930.36, CamY = 2052.78, CamZ = 14.71, lookAtX = 1931.36, lookAtY = 2052.78, lookAtZ = 14.43},
	[4] = {ID = {{536, 2201300}
		,{567, 2258000}
		,{602, 2135100}
		,{534, 2128300}
		,{426, 2214600}
		,{439, 2114600}
		,{412, 2114600}
		,{587, 2087200}
		,{565, 2084900}
		,{589, 2082600}
		,{542, 2071200}
		,{496, 2043900}
		,{535, 2043900}
		,{405, 2127900}
		,{445, 2107300}
		,{518, 1980000}
		}, vPosX = -1950, vPosY = 266, vPosZ = 36.2, PosX = -1954, PosY = 299, PosZ = 34, CamX = -1960.18, CamY = 266.06, CamZ = 37.94, lookAtX = -1959.2, lookAtY = 266.06, lookAtZ = 37.73},
	[5] = {ID = {{411, 3000000}
		,{429, 2765000}
		,{541, 2746700}
		,{451, 2739900}
		,{415, 2593800}
		,{480, 2536800}
		,{402, 2525400}
		,{477, 2484300}
		,{562, 2456900}
		,{506, 2365600}
		,{522, 2856500}
		,{559, 2354200}
		,{560, 2358400}
		,{603, 2253800}
		,{475, 2215000}
		}, vPosX = -1660, vPosY = 1213, vPosZ = 7, PosX = -1634, PosY = 1199, PosZ = 6, CamX = -1648.9, CamY = 1212.27, CamZ = 10.16, lookAtX = -1649.88, lookAtY = 1212.27, lookAtZ = 9.94}
}

VehicleShop_Window = guiCreateWindow(screX-467,screY-387, 450, 375, ".:[Vehicle Shop A7bab iRaQ]:.", false)
guiSetVisible(VehicleShop_Window, false)
guiWindowSetSizable(VehicleShop_Window , false)
guiSetAlpha(VehicleShop_Window, 0.8)
carGrid = guiCreateGridList(23, 26, 430, 270, false, VehicleShop_Window)
guiGridListSetSelectionMode(carGrid, 0)
carColumn = guiGridListAddColumn(carGrid, "Vehicle", 0.5)
costColumn = guiGridListAddColumn(carGrid, "$", 0.3)
carButton = guiCreateButton(180, 340, 110, 20,"شـرآء ألسيارة", false, VehicleShop_Window)
closeButton = guiCreateButton(335, 340, 100, 20, "أغـلآق", false, VehicleShop_Window)
CarNameLabel = guiCreateLabel(305, 300, 100, 16, "أسـم السيارة :", false, VehicleShop_Window)
carColorButton = guiCreateButton(10, 340, 125, 20,"أخـتـيار لون للسيارة", false, VehicleShop_Window)
guiLabelSetColor(CarNameLabel, 255, 0, 0)
CarName = guiCreateLabel(363, 165, 82, 16, "Noun", false, VehicleShop_Window)
guiLabelSetColor(CarName, 0, 255, 0)
CarPriceLabel = guiCreateLabel(295, 310, 100, 16, "سعر ألسيارة:", false, VehicleShop_Window)
guiLabelSetColor(CarPriceLabel,255,0,0)
CarPrice = guiCreateLabel(358, 192, 82, 16, "Noun", false, VehicleShop_Window)
guiLabelSetColor(CarPrice, 0, 255, 0)

for i, M in ipairs(ShopTable) do
	ShopMarker = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 2, 255, 0, 0, 127)
	ShopMarkerShader = createMarker(M["PosX"], M["PosY"], M["PosZ"], "cylinder", 2, 200, 150, 0, 127)
	ShopMarkersTable[ShopMarker] = true
	setElementID(ShopMarker, tostring(i))
	createBlipAttachedTo(ShopMarker, 55, 2, 255, 255, 255, 255, 0, 400)
end

addEventHandler("onClientGUIClick", resourceRoot,
function()
	if (source == carGrid) then
		local carName = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 1)
		local carprice = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 2)
		if guiGridListGetSelectedItem(carGrid) ~= -1 then
			guiSetText(CarName, carName)
			guiSetText(CarPrice, "$"..carprice)
			local carID = getVehicleModelFromName(carName)
			if isElement(veh) then
				setElementModel(veh, carID)
			return end
			veh = createVehicle(carID, ShopTable[i]["vPosX"], ShopTable[i]["vPosY"], ShopTable[i]["vPosZ"])
			setVehicleDamageProof(veh, true)
			setElementFrozen(veh, true)
			setVehicleColor(veh, r1, g1, b1, r2, g2, b2)
			timer = setTimer(function() local x, y, z = getElementRotation(veh) setElementRotation(veh, x, y, z+3) end, 50, 0)
		else
			guiSetText(CarName, "Noun")
			guiSetText(CarPrice, "Noun")
			r1, g1, b1, r2, g2, b2 = math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255)
			if isElement(veh) then
				destroyElement(veh)
			end
			if isTimer(timer) then
				killTimer(timer)
			end
		end
		elseif (source == carColorButton) then
		openColorPicker()
	elseif (source == carButton) then
		if guiGridListGetSelectedItem(carGrid) then
			local carName = guiGridListGetItemText(carGrid, guiGridListGetSelectedItem(carGrid), 1)
			local carID = getVehicleModelFromName(carName)
			local carCost = guiGridListGetItemText (carGrid, guiGridListGetSelectedItem(carGrid), 2)
			local r1, g1, b1, r2, g2, b2 = getVehicleColor(veh, true)
			triggerServerEvent("onBuyNewVehicle", localPlayer, carID, carCost, r1, g1, b1, r2, g2, b2)
			guiSetVisible(VehicleShop_Window, false)
			showCursor(false)
			setElementFrozen(localPlayer, false)
			fadeCamera(false, 1.0)
			setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1)
			if isElement(veh) then
				destroyElement(veh)
			end
			if isTimer(timer) then
				killTimer(timer)
			end
		end
	elseif (source == closeButton) then
		if guiGetVisible(VehicleShop_Window) then 
			guiSetVisible(VehicleShop_Window, false)
			showCursor(false)
			setElementFrozen(localPlayer, false)
			fadeCamera(false, 1.0)
			setTimer(function() fadeCamera(true, 0.5) setCameraTarget(localPlayer) end, 1000, 1)
			if isElement(veh) then
				destroyElement(veh)
			end
			if isTimer(timer) then
				killTimer(timer)
			end
		end
	end
end)

function openColorPicker()
	if (colorPicker.isSelectOpen) or not isElement(veh) then return end
	colorPicker.openSelect(colors)
end

function closedColorPicker()
end

function updateColor()
	if (not colorPicker.isSelectOpen) then return end
	local r, g, b = colorPicker.updateTempColors()
	if (veh and isElement(veh)) then
		r1, g1, b1, r2, g2, b2 = getVehicleColor(veh, true)
		if (guiCheckBoxGetSelected(checkColor1)) then
			r1, g1, b1 = r, g, b
		end
		if (guiCheckBoxGetSelected(checkColor2)) then
			r2, g2, b2 = r, g, b
		end
		setVehicleColor(veh, r1, g1, b1, r2, g2, b2)
	end
end
addEventHandler("onClientRender", root, updateColor)

--[[addCommandHandler("xx", function()
	local x, y, z, lx, ly, lz = getCameraMatrix()
	setCameraMatrix(x, y, z, lx, ly, lz)
	outputChatBox(x..", "..y..", "..z..", "..lx..", "..ly..", "..z)
end)]]

addEventHandler("onClientMarkerHit", resourceRoot,
function(player)
	if getElementType(player) ~= "player" or player ~= localPlayer or isPedInVehicle(player) then return end
	if ShopMarkersTable[source] then
		i = tonumber(getElementID(source))
		guiGridListClear(carGrid)
		for i, v in ipairs(ShopTable[i]["ID"]) do
			local carName = getVehicleNameFromModel(v[1])
			local row = guiGridListAddRow(carGrid)
			guiGridListSetItemText(carGrid, row, 1, carName, false, true)
			guiGridListSetItemText(carGrid, row, 2, tostring(v[2]), false, true)
		end
		setCameraMatrix(ShopTable[i]["CamX"], ShopTable[i]["CamY"], ShopTable[i]["CamZ"], ShopTable[i]["lookAtX"], ShopTable[i]["lookAtY"], ShopTable[i]["lookAtZ"])
		guiSetVisible(VehicleShop_Window, true)
		showCursor(true)
		guiGridListSetSelectedItem(carGrid, 0, 1)
		setTimer(function()
			setElementFrozen(localPlayer, true)
			local carName = guiGridListGetItemText(carGrid, 0, 1)
			local carID = getVehicleModelFromName(carName)
			local x, y, z = ShopTable[i]["vPosX"], ShopTable[i]["vPosY"], ShopTable[i]["vPosZ"]
			if isElement(veh) then
				destroyElement(veh)
			end
			if isTimer(timer) then
				killTimer(timer)
			end
			r1, g1, b1, r2, g2, b2 = math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255), math.random(0, 255)
			veh = createVehicle(carID, x, y, z)
			setVehicleDamageProof(veh, true)
			setElementFrozen(veh, true)
			setVehicleColor(veh, r1, g1, b1, r2, g2, b2)
			timer = setTimer(function() local x, y, z = getElementRotation(veh) setElementRotation(veh, x, y, z+3) end, 50, 0)
		end, 100, 1)
	end
end)


شـكـرآ

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...