DaminkO Posted April 14, 2016 Share Posted April 14, 2016 (edited) local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") end ) function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemData(gridlist, Row, 1, {Value[2][1], Value[2][2], Value[2][3]}) end Edited April 16, 2016 by Guest Link to comment
#|_oskar_|# Posted April 14, 2016 Share Posted April 14, 2016 local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) guiGridListSetItemData(gridlist, Row, 1, {Value[1], Value[2], Value[3]}) end end) Link to comment
#|_oskar_|# Posted April 14, 2016 Share Posted April 14, 2016 شكرا العفو ملاحظه : الخطاء كان من السطر ذا guiGridListSetItemData(gridlist, Row, 1, {Value[2][1], Value[2][2], Value[2][3]}) اللى محدد عليه بالاحمر زيادات يعني هم اللى كانو مخربين عليك المود Link to comment
DaminkO Posted April 14, 2016 Author Share Posted April 14, 2016 اوك ممكن فانكشن حق انزال السياره ؟ Link to comment
DaminkO Posted April 14, 2016 Author Share Posted April 14, 2016 --client local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) guiGridListSetItemData(gridlist, Row, 1, {Value[1], Value[2], Value[3]}) end end) addEventHandler ('onClientGUIClick',GUIEditor.button[1] function () triggerServerEvent ('spawn',Player) end ) --server addEvent ("spawn") addEventHandler ("spawn",Player function () createVehicle (source) end ) وش هو الخطأ Link to comment
Ahmed Ly Posted April 14, 2016 Share Posted April 14, 2016 (edited) --client local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) guiGridListSetItemData(gridlist, Row, 1, {Value[1], Value[2], Value[3]}) end end) addEventHandler ('onClientGUIClick',GUIEditor.button[1] function () triggerServerEvent ('spawn',Player) end ) --server addEvent ("spawn") addEventHandler ("spawn",Player function () createVehicle (source) end ) وش هو الخطأ local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) guiGridListSetItemData(gridlist, Row, 1, {Value[1], Value[2], Value[3]}) end function mm () if (guiGridListGetSelectedItem (gridlist) ) then if (source ==GUIEditor.button[1] ) then local Model = guiGridListGetItemData ( gridlist,guiGridListGetSelectedItem ( gridlist ), 1 ) triggerServerEvent("spawn", localPlayer, Model) end end end addEventHandler ("onClientGUIClick",root,mm) ---- Server function spawn1 (Model) local x,y,z = getElementPosition(source) createVehicle(Model,x,y,z) end addEvent ("spawn",true) addEventHandler ("spawn",root,spawn1) Edited April 14, 2016 by Guest Link to comment
#|_oskar_|# Posted April 14, 2016 Share Posted April 14, 2016 --- لو ضغط ع الزر بتنزل سياره بدون ماتحدد القريد addEventHandler ('onClientGUIClick',GUIEditor.button[1] -- خطاء هنا نسيت تحط ال فاصله function () triggerServerEvent ('spawn',Player) -- هنا البلاير مو معرف end ) غلط x وملف السيرفر كله غلط ----- التسحيح --client local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) end) --server nVehicle = {}, addEvent("spawn",true) addEventHandler("spawn",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) nVehicle[source] = createVehicle (vehicleID, x, y, z+1, 0, 0,r) warpPedIntoVehicle (source,nVehicle[source] ) end) Link to comment
DaminkO Posted April 14, 2016 Author Share Posted April 14, 2016 ابي فنكشنات حق تصليح السياره و سحب السياره و الانتقال للسياره Link to comment
Ahmed Ly Posted April 14, 2016 Share Posted April 14, 2016 ابي فنكشنات حق تصليح السياره و سحب السياره و الانتقال للسياره تصليح السياره fixVehicle Link to comment
iMr.WiFi..! Posted April 14, 2016 Share Posted April 14, 2016 سحب السيارة destroyElement انتقال الى سيارة getElementPosition -- Vechicle setElementPosition -- player Link to comment
DaminkO Posted April 14, 2016 Author Share Posted April 14, 2016 local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) end) addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[3] then local x,y,z = getElementPosition(source) local sel = guiGridListGetSelectedItem ( Cars ) if sel ~= -1 then local ID = guiGridListSetItemData( Cars , guiGridListGetSelectedItem ( gridlist ), 1 ) createVehicle(ID,x,y,z) end end end ) Link to comment
#|_oskar_|# Posted April 15, 2016 Share Posted April 15, 2016 local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) end) addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[3] then local x,y,z = getElementPosition(source) local sel = guiGridListGetSelectedItem ( Cars ) if sel ~= -1 then local ID = guiGridListSetItemData( Cars , guiGridListGetSelectedItem ( gridlist ), 1 ) createVehicle(ID,x,y,z) end end end ) ماتنفع السياره بجهة كلنت والسبب انك ماتقدر تركبها فلازم تكون سيرفر + طرحت لك كود فوق جاهز شوفه واتعلم منه Link to comment
DaminkO Posted April 15, 2016 Author Share Posted April 15, 2016 local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "Spawn Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "Destroy Vehicle", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, "Warp to Vehicle ", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "Warp Vehicle to You", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) end) addEventHandler ( "onClientGUIClick", root, function () if source == GUIEditor.button[3] then local x,y,z = getElementPosition(source) local sel = guiGridListGetSelectedItem ( Cars ) if sel ~= -1 then local ID = guiGridListSetItemData( Cars , guiGridListGetSelectedItem ( gridlist ), 1 ) createVehicle(ID,x,y,z) end end end ) ماتنفع السياره بجهة كلنت والسبب انك ماتقدر تركبها فلازم تكون سيرفر + طرحت لك كود فوق جاهز شوفه واتعلم منه يعني اسوي ترايقر ؟ Link to comment
DaminkO Posted April 15, 2016 Author Share Posted April 15, 2016 ممكن اصلاح الخطأ --Client local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "اضهار سيارة", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "سحب السياره", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, " الانتقال للسياره", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "انتقال السياره", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) addEventHandler ('onClientGUIClick',GUIEditor.button[2],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('Destroy',localPlayer,id) end end,false) end) --Server nVehicle = {}, addEvent("spawn",true) addEventHandler("spawn",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) nVehicle[source] = createVehicle (vehicleID, x, y, z+1, 0, 0,r) warpPedIntoVehicle (source,nVehicle[source] ) end) addEvent("Destroy",true) addEventHandler("Destroy",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) nVehicle[source] = destroyElement (vehicleID, x, y, z+1, 0, 0,r) end) Link to comment
iMr.WiFi..! Posted April 15, 2016 Share Posted April 15, 2016 ممكن اصلاح الخطأ --Client local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "اضهار سيارة", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFABA500") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "سحب السياره", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFABA500") GUIEditor.button[3] = guiCreateButton(469, 163, 221, 51, " الانتقال للسياره", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFABA500") GUIEditor.button[4] = guiCreateButton(468, 224, 221, 51, "انتقال السياره", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFABA500") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) addEventHandler ('onClientGUIClick',GUIEditor.button[2],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('Destroy',localPlayer,id) end end,false) end) --Server nVehicle = {}, addEvent("spawn",true) addEventHandler("spawn",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) nVehicle[source] = createVehicle (vehicleID, x, y, z+1, 0, 0,r) warpPedIntoVehicle (source,nVehicle[source] ) end) addEvent("Destroy",true) addEventHandler("Destroy",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) nVehicle[source] = destroyElement (vehicleID, x, y, z+1, 0, 0,r) end) --Server nVehicle = {}, addEvent("spawn",true) addEventHandler("spawn",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) nVehicle[source] = createVehicle (vehicleID, x, y, z+1) warpPedIntoVehicle (source,nVehicle[source] ) end) addEvent("Destroy",true) addEventHandler("Destroy",root,function (vehicleID) nVehicle[source] = destroyElement (vehicleID) end) Link to comment
DaminkO Posted April 15, 2016 Author Share Posted April 15, 2016 --client local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "xX[spawn Vehicle|اضهار السياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFECB00") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "xX[Destroy Vehicle|سحب السياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFECB00") GUIEditor.button[3] = guiCreateButton(466, 163, 223, 51, "xX[Warp To Vehicle|انتقال للسياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFECB00") GUIEditor.button[4] = guiCreateButton(466, 224, 223, 51, "xX[Warp Vehicle| نقل السياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFECB00") GUIEditor.button[6] = guiCreateButton(544, 308, 220, 56, "xX[Repair|اصلاح]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFECB00") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) addEventHandler ('onClientGUIClick',GUIEditor.button[2],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('Destroy',localPlayer,id) end end,false) addEventHandler ("onClientGUIClick",root, function () if source == GUIEditor.button[3] then if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent("WarpToVehicle",source,id) end end end,false) --Server nVehicle = {}, addEvent("spawn",true) addEventHandler("spawn",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) nVehicle[source] = createVehicle (vehicleID, x, y, z+1, 0, 0,r) warpPedIntoVehicle (source,nVehicle[source] ) end) addEvent("Destroy",true) addEventHandler("Destroy",root,function (vehicleID) destroyElement (nVehicle[source]) end) addEvent("WarpToVehicle",true) addEventHandler("WarpToVehicle",root, function (source , id) warpPlayerIntoVehicle (source , id) end ) Link to comment
Me[Z]oO Posted April 15, 2016 Share Posted April 15, 2016 #تم التجربة --Client local key = "F5" GUIEditor = { gridlist = {}, window = {}, button = {} } local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 699) / 2, (screenH - 493) / 2, 699, 493, "xX[rent system]Xx", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFEF500") guiSetVisible (GUIEditor.window[1],false) gridlist = guiCreateGridList(11, 33, 448, 450, false, GUIEditor.window[1]) guiGridListAddColumn(gridlist, "ID", 0.5) guiGridListAddColumn(gridlist, "Car Name", 0.5) GUIEditor.button[1] = guiCreateButton(466, 35, 223, 51, "xX[spawn Vehicle|اضهار السياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFECB00") GUIEditor.button[2] = guiCreateButton(466, 96, 223, 51, "xX[Destroy Vehicle|سحب السياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFECB00") GUIEditor.button[3] = guiCreateButton(466, 163, 223, 51, "xX[Warp To Vehicle|انتقال للسياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFFECB00") GUIEditor.button[4] = guiCreateButton(466, 224, 223, 51, "xX[Warp Vehicle| نقل السياره]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFFECB00") GUIEditor.button[6] = guiCreateButton(544, 308, 220, 56, "xX[Repair|اصلاح]Xx", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFFECB00") function Show_Hide() if guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1], true) showCursor(true) else guiSetVisible(GUIEditor.window[1], false) showCursor(false) end end bindKey(key,"down",Show_Hide) Cars = { {"Infernus",411} } for Key, Value in ipairs(Cars) do local Row = guiGridListAddRow(gridlist) guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false) guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false) end addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('spawn',localPlayer,id) end end,false) addEventHandler ('onClientGUIClick',GUIEditor.button[2],function () if ( guiGridListGetSelectedItem (gridlist) ~= -1 ) then local id = guiGridListGetItemText (gridlist,guiGridListGetSelectedItem (gridlist),2) triggerServerEvent('Destroy',localPlayer,id) end end,false) addEventHandler ("onClientGUIClick",root, function () if source == GUIEditor.button[3] then triggerServerEvent("WarpToVehicle",localPlayer) end end) addEventHandler ("onClientGUIClick",root, function () if source == GUIEditor.button[4] then triggerServerEvent("mezo",localPlayer) end end) addEventHandler ("onClientGUIClick",root, function () if source == GUIEditor.button[6] then triggerServerEvent("mezo3",localPlayer) end end) --Server nVehicle = {}, addEvent("spawn",true) addEventHandler("spawn",root,function (vehicleID) local x, y, z = getElementPosition (source) local _,_,r = getPedRotation (source) if isElement(nVehicle[source]) then destroyElement(nVehicle[source]) else nVehicle[source] = createVehicle (vehicleID, x, y, z+1, 0, 0,r) warpPedIntoVehicle (source,nVehicle[source] ) end addEvent("WarpToVehicle",true) addEventHandler("WarpToVehicle",root, function () warpPlayerIntoVehicle (source , nVehicle[source]) end ) addEvent("mezo",true) addEventHandler("mezo",root, function () x,y,z = getElementPosition(source) setElementPosition(nVehicle[source],x,y,z) end ) addEvent("mezo3",true) addEventHandler("mezo3",root, function () fixVehicle(nVehicle[source]) end ) end) addEvent("Destroy",true) addEventHandler("Destroy",root,function (vehicleID) destroyElement (nVehicle[source]) end) صلحت لك لو دست ع الزر اكتر من مرة يسوي اكثر من سيارة صلحت لك بعد التريقرات وضفت لك تريقر اصلا السيارة وتريقر انتقال السيارة لك وسحب السيارة لك Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now