Jump to content

# اصلاح خطأ


Recommended Posts

--client 
local key = "o" 
GUIEditor = { 
    checkbox = {}, 
    label = {}, 
    button = {}, 
    window = {}, 
    scrollbar = {}, 
    gridlist = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
local screenW, screenH = guiGetScreenSize() 
        GUIEditor.window[1] = guiCreateWindow((screenW - 573) / 2, (screenH - 481) / 2, 573, 481, "نضام الإستئجار (لوحة التحكم)", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFB7A700") 
        guiSetVisible (GUIEditor.window[1],false) 
        GUIEditor.gridlist[1] = guiCreateGridList(9, 32, 342, 403, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "الأي دي", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "اسم المركبة", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "نوع المركبة", 0.3) 
  
        
  
        GUIEditor.button[1] = guiCreateButton(361, 42, 202, 47, "صنع مركبة", false, GUIEditor.window[1]) --1 
        GUIEditor.button[2] = guiCreateButton(361, 99, 202, 47, "ازالة مركبة", false, GUIEditor.window[1]) --2 
        GUIEditor.button[3] = guiCreateButton(361, 156, 202, 47, "اصلاح مركبة", false, GUIEditor.window[1]) --3 
        GUIEditor.button[4] = guiCreateButton(362, 213, 201, 47, "انتقال الى المركبة", false, GUIEditor.window[1]) --4 
        GUIEditor.button[5] = guiCreateButton(361, 270, 201, 47, "سحب المركبة", false, GUIEditor.window[1]) 
        GUIEditor.button[6] = guiCreateButton(362, 325, 200, 20, "X", false, GUIEditor.window[1]) 
        GUIEditor.label[2] = guiCreateLabel(729, 208, 199, 15, "~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "sa-header") 
        GUIEditor.label[3] = guiCreateLabel(356, 356, 408, 84, "~~~~~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[3], "sa-gothic") 
        guiLabelSetColor(GUIEditor.label[3], 183, 167, 0)     
    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) 
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("fix",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[4] then 
triggerServerEvent("WarpToVehicle",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[5] then 
triggerServerEvent("warpVehicle",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("warpVehicle",true) 
addEventHandler("warpVehicle",root, 
function () 
x,y,z = getElementPosition(source) 
setElementPosition(nVehicle[source],x,y,z) 
end 
) 
addEvent("fix",true) 
addEventHandler("fix",root, 
function () 
fixVehicle(nVehicle[source]) 
end 
) 
end) 
  
addEvent("Destroy",true) 
addEventHandler("Destroy",root,function (vehicleID) 
destroyElement (nVehicle[source]) 
end) 

Link to comment
Car = { 
{"Infernus",411}, 
} 
  
for i,k in ipairs (Car) do 
local rw = guiGridListAddRow (GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],rw,1,tostring(k[1]),false,false) 
guiGridListSetItemData (GUIEditor.gridlist[1],rw,1,tonumber(k[2])) 
end 

تفضل اخى العزيز جربه

Edited by Guest
Link to comment

GUIEditor.gridlist[1] = guiCreateGridList(9, 32, 342, 403, false, GUIEditor.window[1])

local Row = guiGridListAddRow(gridlist )

guiGridListSetItemText(gridlist, Row, 1, Value[1], false, false)

guiGridListSetItemText(gridlist, Row, 2, Value[2], false, false)

end

Link to comment
-client 
local key = "o" 
GUIEditor = { 
    checkbox = {}, 
    label = {}, 
    button = {}, 
    window = {}, 
    scrollbar = {}, 
    gridlist = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
local screenW, screenH = guiGetScreenSize() 
        GUIEditor.window[1] = guiCreateWindow((screenW - 573) / 2, (screenH - 481) / 2, 573, 481, "نضام الإستئجار (لوحة التحكم)", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFB7A700") 
        guiSetVisible (GUIEditor.window[1],false) 
        GUIEditor.gridlist[1] = guiCreateGridList(9, 32, 342, 403, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "الأي دي", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "اسم المركبة", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "نوع المركبة", 0.3) 
  
        
  
        GUIEditor.button[1] = guiCreateButton(361, 42, 202, 47, "صنع مركبة", false, GUIEditor.window[1]) --1 
        GUIEditor.button[2] = guiCreateButton(361, 99, 202, 47, "ازالة مركبة", false, GUIEditor.window[1]) --2 
        GUIEditor.button[3] = guiCreateButton(361, 156, 202, 47, "اصلاح مركبة", false, GUIEditor.window[1]) --3 
        GUIEditor.button[4] = guiCreateButton(362, 213, 201, 47, "انتقال الى المركبة", false, GUIEditor.window[1]) --4 
        GUIEditor.button[5] = guiCreateButton(361, 270, 201, 47, "سحب المركبة", false, GUIEditor.window[1]) 
        GUIEditor.button[6] = guiCreateButton(362, 325, 200, 20, "X", false, GUIEditor.window[1]) 
        GUIEditor.label[2] = guiCreateLabel(729, 208, 199, 15, "~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "sa-header") 
        GUIEditor.label[3] = guiCreateLabel(356, 356, 408, 84, "~~~~~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[3], "sa-gothic") 
        guiLabelSetColor(GUIEditor.label[3], 183, 167, 0)     
    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(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 1, Value[1], false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 2, Value[2], false, false) 
end 
  
addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () 
if ( guiGridListGetSelectedItem (GUIEditor.gridlist[1]) ~= -1 ) then 
local id = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem (gridlist),2) 
triggerServerEvent('spawn',localPlayer,id) 
end 
end,false) 
  
addEventHandler ('onClientGUIClick',GUIEditor.button[2],function () 
if ( guiGridListGetSelectedItem (GUIEditor.gridlist[1]) ~= -1 ) then 
local id = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem (GUIEditor.gridlist[1]),2) 
triggerServerEvent('Destroy',localPlayer,id) 
end 
end,false) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[3] then 
triggerServerEvent("fix",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[4] then 
triggerServerEvent("WarpToVehicle",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[5] then 
triggerServerEvent("warpVehicle",localPlayer) 
end 
end) 

Link to comment
  
local key = "o" 
GUIEditor = { 
    checkbox = {}, 
    label = {}, 
    button = {}, 
    window = {}, 
    scrollbar = {}, 
    gridlist = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
local screenW, screenH = guiGetScreenSize() 
        GUIEditor.window[1] = guiCreateWindow((screenW - 573) / 2, (screenH - 481) / 2, 573, 481, "نضام الإستئجار (لوحة التحكم)", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFB7A700") 
        guiSetVisible (GUIEditor.window[1],false) 
        GUIEditor.gridlist[1] = guiCreateGridList(9, 32, 342, 403, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "الأي دي", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "اسم المركبة", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "نوع المركبة", 0.3) 
  
        
  
        GUIEditor.button[1] = guiCreateButton(361, 42, 202, 47, "صنع مركبة", false, GUIEditor.window[1]) --1 
        GUIEditor.button[2] = guiCreateButton(361, 99, 202, 47, "ازالة مركبة", false, GUIEditor.window[1]) --2 
        GUIEditor.button[3] = guiCreateButton(361, 156, 202, 47, "اصلاح مركبة", false, GUIEditor.window[1]) --3 
        GUIEditor.button[4] = guiCreateButton(362, 213, 201, 47, "انتقال الى المركبة", false, GUIEditor.window[1]) --4 
        GUIEditor.button[5] = guiCreateButton(361, 270, 201, 47, "سحب المركبة", false, GUIEditor.window[1]) 
        GUIEditor.button[6] = guiCreateButton(362, 325, 200, 20, "X", false, GUIEditor.window[1]) 
        GUIEditor.label[2] = guiCreateLabel(729, 208, 199, 15, "~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "sa-header") 
        GUIEditor.label[3] = guiCreateLabel(356, 356, 408, 84, "~~~~~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[3], "sa-gothic") 
        guiLabelSetColor(GUIEditor.label[3], 183, 167, 0)     
    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} 
} 
  
function() 
for Key, Value in ipairs(Cars) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 1, Value[1], false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 2, Value[2], false, false) 
end 
end 
  
addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () 
if ( guiGridListGetSelectedItem (GUIEditor.gridlist[1]) ~= -1 ) then 
local id = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem (gridlist),2) 
triggerServerEvent('spawn',localPlayer,id) 
end 
end,false) 
  
addEventHandler ('onClientGUIClick',GUIEditor.button[2],function () 
if ( guiGridListGetSelectedItem (GUIEditor.gridlist[1]) ~= -1 ) then 
local id = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem (GUIEditor.gridlist[1]),2) 
triggerServerEvent('Destroy',localPlayer,id) 
end 
end,false) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[3] then 
triggerServerEvent("fix",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[4] then 
triggerServerEvent("WarpToVehicle",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[5] then 
triggerServerEvent("warpVehicle",localPlayer) 
end 
end) 

Link to comment

جرب

د

انا متاكد

------------- كلنت------------------  
local key = "o" 
GUIEditor = { 
    checkbox = {}, 
    label = {}, 
    button = {}, 
    window = {}, 
    scrollbar = {}, 
    gridlist = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
local screenW, screenH = guiGetScreenSize() 
        GUIEditor.window[1] = guiCreateWindow((screenW - 573) / 2, (screenH - 481) / 2, 573, 481, "نضام الإستئجار (لوحة التحكم)", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFB7A700") 
        guiSetVisible (GUIEditor.window[1],false) 
        GUIEditor.gridlist[1] = guiCreateGridList(9, 32, 342, 403, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "الأي دي", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "اسم المركبة", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "نوع المركبة", 0.3) 
  
        
  
        GUIEditor.button[1] = guiCreateButton(361, 42, 202, 47, "صنع مركبة", false, GUIEditor.window[1]) --1 
        GUIEditor.button[2] = guiCreateButton(361, 99, 202, 47, "ازالة مركبة", false, GUIEditor.window[1]) --2 
        GUIEditor.button[3] = guiCreateButton(361, 156, 202, 47, "اصلاح مركبة", false, GUIEditor.window[1]) --3 
        GUIEditor.button[4] = guiCreateButton(362, 213, 201, 47, "انتقال الى المركبة", false, GUIEditor.window[1]) --4 
        GUIEditor.button[5] = guiCreateButton(361, 270, 201, 47, "سحب المركبة", false, GUIEditor.window[1]) 
        GUIEditor.button[6] = guiCreateButton(362, 325, 200, 20, "X", false, GUIEditor.window[1]) 
        GUIEditor.label[2] = guiCreateLabel(729, 208, 199, 15, "~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[2], "sa-header") 
        GUIEditor.label[3] = guiCreateLabel(356, 356, 408, 84, "~~~~~~~~~~~~", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[3], "sa-gothic") 
        guiLabelSetColor(GUIEditor.label[3], 183, 167, 0)     
    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(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 1, Value[1], false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 2, Value[2], false, false) 
end 
  
addEventHandler ('onClientGUIClick',GUIEditor.button[1],function () 
if ( guiGridListGetSelectedItem (GUIEditor.gridlist[1]) ~= -1 ) then 
local id = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem (gridlist),2) 
triggerServerEvent('spawn',localPlayer,id) 
end 
end,false) 
  
addEventHandler ('onClientGUIClick',GUIEditor.button[2],function () 
if ( guiGridListGetSelectedItem (GUIEditor.gridlist[1]) ~= -1 ) then 
local id = guiGridListGetItemText (GUIEditor.gridlist[1],guiGridListGetSelectedItem (GUIEditor.gridlist[1]),2) 
triggerServerEvent('Destroy',localPlayer,id) 
end 
end,false) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[3] then 
triggerServerEvent("fix",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[4] then 
triggerServerEvent("WarpToVehicle",localPlayer) 
end 
end) 
  
addEventHandler ("onClientGUIClick",root, 
function () 
if source == GUIEditor.button[5] then 
triggerServerEvent("warpVehicle",localPlayer) 
end 
end) 

Link to comment
function mido() 
for Key, Value in ipairs(Cars) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 1, Value[1], false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 2, Value[2], false, false) 
end 
end 
-- محتاج هنا addEventHandler 

Link to comment
function mido() 
for Key, Value in ipairs(Cars) do 
local Row = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 1, Value[1], false, false) 
guiGridListSetItemText(GUIEditor.gridlist[1], Row, 2, Value[2], false, false) 
end 
end 
-- محتاج هنا addEventHandler 

مايحتاج addEventHandler

:idea::|

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...