Jump to content

مشكلة اللوحات


Recommended Posts

شباب ان مسوي اكثر من لوحة فيها قريد ليست وماتشتغل انا بعطيكم واحدة

تكفى صححوها + وروني الاخطاء بالتفصيل وطريقة التصحيح

#Client Side 
wnd = guiCreateWindow(356, 181, 312, 392, "لوحة الانتقال", false) 
            
GUIEditor.label[1] = guiCreateLabel(60, 28, 232, 30, "اختر المكان الذي تريد الانتقال إليه:", false, wnd)              
gridlist = guiCreateGridList(10, 56, 292, 270, false, wnd) 
         
guiGridListAddColumn(gridlist, "الأماكن", 0.9) 
         
loacl am = {{"ffs",1000,300,23}}  
button = guiCreateButton(101, 336, 116, 46, "انتقال", false, wnd) 
  
for k,v in ipairs(am) do 
guiGridListAddRow(gridlist) 
         
guiGridListSetItemText(gridlist, 0, 1, v[1], false, false)  
guiGridListSetItemData(gridlist, 0, 1, v[2] and v[3] and v[4]) 
end 
guiLabelSetColor(GUIEditor.label[1], 253, 0, 239) 
  
guiSetVisible (wnd, false)            
guiSetProperty(wnd, "CaptionColour", "FF00FCFE") 
  
   
  
bindKey ("F6", "down" 
function () 
  if (guiGetVisible(wnd) == false) then 
    guiSetVisible (wnd, true) 
    showCursor (true) 
  else 
    guiSetVisible (wnd, false) 
    showCursor (false) 
  end 
end) 
--- 
  
function click (button, state, absoluteX, absoluteYe) 
  if (source == button) then  
    if (guiGridListGetSelectedItem (gridlist)) then 
      local name = guiGridListGetItemText (gridlist, guiGridListGetSelectedItem (gridlist), 1) 
      local x,y,z = guiGridListGetItemData (gridlist, guiGridListGetSelectedItem (gridlist), 1) 
      setElementPosition(localPlayer, x, y, z) 
      outputChatBox("لقد انتقلت إلى " ..name, source, 255 , 0, 120, false) 
    end 
  end 
end 
addEventHandler ("onClientGUIClick", getRootElement(), click) 

Link to comment

صححت الي بكودك بس فيه اخطأ واشياء ناقصة

local am = [x,y,z] 
  
    wnd = guiCreateWindow(356, 181, 312, 392, "لوحة الانتقال", false) 
    guiSetVisible (wnd, false)           
    guiSetProperty(wnd, "CaptionColour", "FF00FCFE")           
    GUIEditor.label[1] = guiCreateLabel(60, 28, 232, 30, "اختر المكان الذي تريد الانتقال إليه:",false,wnd)      
    guiLabelSetColor(GUIEditor.label[1], 253, 0, 239)   
    gridlist = guiCreateGridList(10, 56, 292, 270, false,wnd)      
    guiGridListAddColumn(gridlist, "الأماكن",0.9)          
    button = guiCreateButton(101, 336, 116, 46, "انتقال", false, wnd) 
     
for k,v in ipairs(am) do 
    guiGridListClear (gridList) 
    guiGridListAddRow(gridlist)       
    guiGridListSetItemText(gridlist,0,1,v[1],false,false) 
    guiGridListSetItemData(gridlist,0,1,v[2]and v[3] and v[4]) 
end 
  
bindKey ( "F6" , "down" , 
    function () 
    if guiGetVisible ( wnd , true ) then 
            guiSetVisible ( wnd , false ) 
            showCursor ( false ) 
        else 
            guiSetVisible ( wnd , true ) 
            showCursor ( true ) 
        end 
    end 
)      
addEventHandler ("onClientGUIClick",getRootElement(), 
function () 
      if (source == button) then 
        local row = guiGridListGetSelectedItem(source) 
        if (row ~= -1) then 
        local player = guiGridListGetItemData(gridlist,1) 
        if (player) then 
          setElementPosition(localPlayer,player) 
          outputChatBox("لقد انتقلت إلى "..player.."",source,255,0,120,true) 
        end 
      end 
    end 
end 
) 
Link to comment

ابو زهره , كودك فيه اخطاء كثير ...

بالنسبه لصاحب الموضوع اخطائك كثير ...

-- Client Side # 
wnd = guiCreateWindow(356, 181, 312, 392, 'لوحة الانتقال', false)      
label = guiCreateLabel(60, 28, 232, 30, 'اختر المكان الذي تريد الانتقال إليه:', false, wnd)       
button = guiCreateButton(101, 336, 116, 46, 'انتقال', false, wnd)       
gridlist = guiCreateGridList(10, 56, 292, 270, false, wnd) 
guiLabelSetColor(label, 253, 0, 239) 
guiGridListAddColumn(gridlist, 'الأماكن', 0.9) 
guiSetVisible (wnd, false)           
guiSetProperty(wnd, 'CaptionColour', 'FF00FCFE') 
  
local am = {{'ffs',1000,300,23}} 
  
for k,v in ipairs(am) do 
    local row = guiGridListAddRow(gridlist)       
        guiGridListSetItemText(gridlist, row, 1, v[1], false, false) 
            guiGridListSetItemData(gridlist, row, 1, { v[2] , v[3] , v[4] } ) 
end 
  
bindKey ('F6', 'down',function () 
    guiSetVisible (wnd, not guiGetVisible ( wnd ) ) 
    showCursor (guiGetVisible ( wnd )) 
end) 
  
function click () 
    if (source == button) then 
        if (guiGridListGetSelectedItem (gridlist)) ~= -1 then 
            local name = guiGridListGetItemText (gridlist, guiGridListGetSelectedItem (gridlist), 1) 
                local position = guiGridListGetItemData (gridlist, guiGridListGetSelectedItem (gridlist), 1) 
                    setElementPosition(localPlayer, position[1], position[2], position[3]) 
                        outputChatBox('لقد انتقلت إلى ' ..name, source, 255 , 0, 120, false) 
            end 
        end 
    end 
addEventHandler ('onClientGUIClick', root, click) 
Link to comment

! فـ بيكون خطأ GUIEditor مافيه جدول اسمه GUIEditor.label[1] اول خطأ انك كنت حاط متغير اللبل

ثانيا خطأ عندك كان سطر 15 و 16 السطر انت حاطه 0 , فـ لو عندك قيمتين كيف تحطهم بسطر واحد؟ , شوف انا كيف سويت ذذ

,{ v[2] , v[3] , v[4] } وهذا خطأ , الاسهل انك تسوي جدول بسيط and ثالث خطأ عندك كان سطر 16 , حطيت

(وتجيب قيمهم بإستخدام الاندكس ( رقم القيمه

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