Jump to content

تصحيح خطأ


Recommended Posts

function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
MKAN = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
MKAN = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",1521.77258,-1677.03223,13.54688}, 
    {"المجمع السكني",3393.76758,-1732.79016,10.90000}, 
    {"حارة سي جي",2491.12109375, -1667.4482421875, 13.34375}, 
    {"السد الكبير",-887.02734375, 2000.9217529297, 60.654315948486}, 
    {"الدائري",1678.33533, 1447.70569, 10.77515}, 
    {"شارع النخيل",2068.1389160156, 1008.2157592773, 10.671875}, 
    {"شارع الفروسيه",2878.1115722656, -1110.029296875, 10.882762908936}, 
    {"شارع الغروب",662.55310058594, 1936.7479248047, 5.5052728652954}, 
    {"ساحه التفجير",-2051.4926757813, -173.29304504395, 35.3203125}, 
        {"الجسر المعلق", -1160.81372,1078.04163,40.23039}, 
        {"معرض السيارات 1", -1988.24353,287.47321,34.30679}, 
        {"معرض السيارات 2", 2128.78906,-1126.25452,25.53082}, 
        {"معرض السيارات 3", 544.69055,-1273.57458,17.24824}, 
        {"معرض السيارات 4", 1917.88013,2070.78638,10.82031}, 
        {"السينما",-2012.24548,441.59763,35.17188}, 
  
} 
  
  
------------ 
  
bindKey("f6","down", 
    function () 
        guiSetVisible(wnd,not guiGetVisible(wnd)) 
        showCursor(guiGetVisible(wnd)) 
    end 
) 
  
for i,mk in ipairs(MKAN) do 
    local row = guiGridListAddRow(grid) 
    guiGridListSetItemText(grid,row,1,mk[1],false,false) 
    guiGridListSetItemData(grid,row,1,{mk[2],mk[3],mk[4]}) 
    guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
end 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if sel ~= -1 then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                setElementPosition(localPlayer,x,y,z) 
            else 
                outputChatBox("* الرجاء اختيار مكان",255,0,0) 
            end 
        end 
    end 
) 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == move ) then 
            guiSetVisible(wnd,false) 
            showCursor(false) 
end )  

Link to comment

مو حاط احداثيات عند مركز الشرطه ومو مغلق الجدول, ناقصك اند end

  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
MKAN = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",0,0,0} 
} 
  
  
  
  
 function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
MKAN = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",1521.77258,-1677.03223,13.54688}, 
    {"المجمع السكني",3393.76758,-1732.79016,10.90000}, 
    {"حارة سي جي",2491.12109375, -1667.4482421875, 13.34375}, 
    {"السد الكبير",-887.02734375, 2000.9217529297, 60.654315948486}, 
    {"الدائري",1678.33533, 1447.70569, 10.77515}, 
    {"شارع النخيل",2068.1389160156, 1008.2157592773, 10.671875}, 
    {"شارع الفروسيه",2878.1115722656, -1110.029296875, 10.882762908936}, 
    {"شارع الغروب",662.55310058594, 1936.7479248047, 5.5052728652954}, 
    {"ساحه التفجير",-2051.4926757813, -173.29304504395, 35.3203125}, 
        {"الجسر المعلق", -1160.81372,1078.04163,40.23039}, 
        {"معرض السيارات 1", -1988.24353,287.47321,34.30679}, 
        {"معرض السيارات 2", 2128.78906,-1126.25452,25.53082}, 
        {"معرض السيارات 3", 544.69055,-1273.57458,17.24824}, 
        {"معرض السيارات 4", 1917.88013,2070.78638,10.82031}, 
        {"السينما",-2012.24548,441.59763,35.17188}, 
  
} 
  
  
------------ 
  
bindKey("f6","down", 
function () 
        guiSetVisible(wnd,not guiGetVisible(wnd)) 
showCursor(guiGetVisible(wnd)) 
end 
) 
  
for i,mk in ipairs(MKAN) do 
    local row = guiGridListAddRow(grid) 
    guiGridListSetItemText(grid,row,1,mk[1],false,false) 
    guiGridListSetItemData(grid,row,1,{mk[2],mk[3],mk[4]}) 
    guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
end 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if sel ~= -1 then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                setElementPosition(localPlayer,x,y,z) 
            else 
                outputChatBox("* الرجاء اختيار مكان",255,0,0) 
            end 
        end 
    end 
) 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == move ) then 
            guiSetVisible(wnd,false) 
            showCursor(false) 
end 
end 
) 
  
  

Link to comment
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
MKAN = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
MKAN = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",1521.77258,-1677.03223,13.54688}, 
    {"المجمع السكني",3393.76758,-1732.79016,10.90000}, 
    {"حارة سي جي",2491.12109375, -1667.4482421875, 13.34375}, 
    {"السد الكبير",-887.02734375, 2000.9217529297, 60.654315948486}, 
    {"الدائري",1678.33533, 1447.70569, 10.77515}, 
    {"شارع النخيل",2068.1389160156, 1008.2157592773, 10.671875}, 
    {"شارع الفروسيه",2878.1115722656, -1110.029296875, 10.882762908936}, 
    {"شارع الغروب",662.55310058594, 1936.7479248047, 5.5052728652954}, 
    {"ساحه التفجير",-2051.4926757813, -173.29304504395, 35.3203125}, 
        {"الجسر المعلق", -1160.81372,1078.04163,40.23039}, 
        {"معرض السيارات 1", -1988.24353,287.47321,34.30679}, 
        {"معرض السيارات 2", 2128.78906,-1126.25452,25.53082}, 
        {"معرض السيارات 3", 544.69055,-1273.57458,17.24824}, 
        {"معرض السيارات 4", 1917.88013,2070.78638,10.82031}, 
        {"السينما",-2012.24548,441.59763,35.17188}, 
  
} 
  
  
------------ 
  
bindKey("f6","down", 
    function () 
        guiSetVisible(wnd,not guiGetVisible(wnd)) 
        showCursor(guiGetVisible(wnd)) 
    end 
) 
  
for i,mk in ipairs(MKAN) do 
    local row = guiGridListAddRow(grid) 
    guiGridListSetItemText(grid,row,1,mk[1],false,false) 
    guiGridListSetItemData(grid,row,1,{mk[2],mk[3],mk[4]}) 
    guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
end 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if sel ~= -1 then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                setElementPosition(localPlayer,x,y,z) 
            else 
                outputChatBox("* الرجاء اختيار مكان",255,0,0) 
            end 
        end 
    end 
) 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == move ) then 
            guiSetVisible(wnd,false) 
            showCursor(false) 
end )  

function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
MKAN = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",1521.77258,-1677.03223,13.54688}, 
    {"المجمع السكني",3393.76758,-1732.79016,10.90000}, 
    {"حارة سي جي",2491.12109375, -1667.4482421875, 13.34375}, 
    {"السد الكبير",-887.02734375, 2000.9217529297, 60.654315948486}, 
    {"الدائري",1678.33533, 1447.70569, 10.77515}, 
    {"شارع النخيل",2068.1389160156, 1008.2157592773, 10.671875}, 
    {"شارع الفروسيه",2878.1115722656, -1110.029296875, 10.882762908936}, 
    {"شارع الغروب",662.55310058594, 1936.7479248047, 5.5052728652954}, 
    {"ساحه التفجير",-2051.4926757813, -173.29304504395, 35.3203125}, 
        {"الجسر المعلق", -1160.81372,1078.04163,40.23039}, 
        {"معرض السيارات 1", -1988.24353,287.47321,34.30679}, 
        {"معرض السيارات 2", 2128.78906,-1126.25452,25.53082}, 
        {"معرض السيارات 3", 544.69055,-1273.57458,17.24824}, 
        {"معرض السيارات 4", 1917.88013,2070.78638,10.82031}, 
        {"السينما",-2012.24548,441.59763,35.17188}, 
  
} 
  
  
------------ 
  
bindKey("f6","down", 
    function () 
        guiSetVisible(wnd,not guiGetVisible(wnd)) 
        showCursor(guiGetVisible(wnd)) 
    end 
) 
  
for i,mk in ipairs(MKAN) do 
    local row = guiGridListAddRow(grid) 
    guiGridListSetItemText(grid,row,1,mk[1],false,false) 
    guiGridListSetItemData(grid,row,1,{mk[2],mk[3],mk[4]}) 
    guiGridListSetItemColor(grid,row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
end 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        local sel = guiGridListGetSelectedItem(grid) 
        if source == move then 
            if sel ~= -1 then 
                local x,y,z = unpack(guiGridListGetItemData(grid,sel,1)) 
                setElementPosition(localPlayer,x,y,z) 
            else 
                outputChatBox("* الرجاء اختيار مكان",255,0,0) 
            end 
        end 
    end 
) 
  
addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == move ) then 
            guiSetVisible(wnd,false) 
            showCursor(false) 
end )  

Link to comment
وين باقي الاكواد ؟ -_- الخطاء مب موجود بالاكوواد الي انت حاطها

ليش معصب ض ؟

اسويلك شاي :D

امزح امزح , منور احزان

:) موب معصب ض1

لكن مو حاط الاكواد الي بها الخطاء :lol:

بنورك ..

Link to comment

--@-- By Soking 
  
function centerWindow(center_window) 
    local screenW,screenH=guiGetScreenSize() 
    local windowW,windowH=guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  
function SetWindowVisible ( Panel , StatsP , StatsC ) 
    guiSetVisible( Panel , StatsP) 
        showCursor( StatsC ) 
            centerWindow( Panel ) 
end 
  
function SetPlayerPosition( Element ,xPos ,yPos ,zPos ) 
    if ( Element ) and isElement( Element ) and ( getElementType( Element ) == 'player' ) then 
        if ( getElementHealth( Element ) > 0 ) then 
                fadeCamera( false ) 
                    setTimer(function( ) 
                        fadeCamera( true ) 
                            setElementPosition(Element, xPos, yPos ,zPos) 
            end , 4000 , 1 ) 
        end 
    end 
end  
  
  
wnd = guiCreateWindow(212, 145, 378, 289, "Test", false) 
guiWindowSetSizable(wnd, false) 
guiSetVisible(wnd,false) 
grid = guiCreateGridList(9, 24, 361, 218, false, wnd) 
guiGridListAddColumn(grid, "Name ", 0.9) 
guiSetFont(grid,"default-bold-small") 
move = guiCreateButton(9, 250, 361, 27, "Warp", false, wnd)     
guiSetFont(move,"default-bold-small") 
  
  
Table = { 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"البداية",3490.43726,-1940.38354,12.18125}, 
    {"الحلبه",2817.75806,-1743.10510,9.97133}, 
    {"البنك",1478.26538,-1705.67419,14.04688}, 
    {"مركز الشرطة",1521.77258,-1677.03223,13.54688}, 
    {"المجمع السكني",3393.76758,-1732.79016,10.90000}, 
    {"حارة سي جي",2491.12109375, -1667.4482421875, 13.34375}, 
    {"السد الكبير",-887.02734375, 2000.9217529297, 60.654315948486}, 
    {"الدائري",1678.33533, 1447.70569, 10.77515}, 
    {"شارع النخيل",2068.1389160156, 1008.2157592773, 10.671875}, 
    {"شارع الفروسيه",2878.1115722656, -1110.029296875, 10.882762908936}, 
    {"شارع الغروب",662.55310058594, 1936.7479248047, 5.5052728652954}, 
    {"ساحه التفجير",-2051.4926757813, -173.29304504395, 35.3203125}, 
    {"الجسر المعلق", -1160.81372,1078.04163,40.23039}, 
    {"معرض السيارات 1", -1988.24353,287.47321,34.30679}, 
    {"معرض السيارات 2", 2128.78906,-1126.25452,25.53082}, 
    {"معرض السيارات 3", 544.69055,-1273.57458,17.24824}, 
    {"معرض السيارات 4", 1917.88013,2070.78638,10.82031}, 
    {"السينما",-2012.24548,441.59763,35.17188} 
} 
  
bindKey("F6","down",function ( ) local Get = guiGetVisible(wnd) SetWindowVisible ( wnd, not Get , not Get ) end ) 
  
for _,Valc in ipairs( Table ) do 
    local Row = guiGridListAddRow(grid) 
        guiGridListSetItemText(grid,Row,1,Valc[1],false,false) 
        guiGridListSetItemData(grid,Row,1,{Valc[2],Valc[3],Valc[4]} ) 
        guiGridListSetItemColor(grid,Row,1,math.random(0,255),math.random(0,255),math.random(0,255)) 
end 
  
addEventHandler("onClientGUIClick",move, 
function () 
    local Selected = guiGridListGetSelectedItem(grid) 
        if ( Selected ~= -1 ) then 
            local xPosition, yPosition, zPosition = unpack(guiGridListGetItemData(grid,Selected,1)) 
                SetPlayerPosition( localPlayer ,xPosition, yPosition, zPosition ) 
                    SetWindowVisible ( wnd , false, false ) 
                        outputChatBox("*Welcome :"..getPlayerName(localPlayer),255,255,255) 
            else 
                        outputChatBox("* الرجاء اختيار مكان",255,0,0) 
    end 
end , false ) 
  
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...