Jump to content

طلب مساعده بسيطه


Recommended Posts

السلام عليكم ورحمه الله وبركاته

وطلبي :

أبي قريد لست

فيها أسماء

مثل

نواف

عمر

عائشه

فاطمه

محمد

وتختار وحده وتضغط على زر

مثلاً انا أخترت

عمر

يجي في التاب

الأسم

وتحته

عمر

:)

أضن أنه وآضح

وهاذي للتسهيل شوي :$

        GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "الأسماء", 0.9) 
        GUIEditor.button[1] = guiCreateButton(75, 232, 74, 21, "أختيــار", false, GUIEditor.window[1]) 

كود معقد حاولت فيه وخربطت وقلت أبي مسآعده :/

ومن زمان ناوي أطرح هالموضوع .. :roll:

Link to comment

ججيت بساعدك شوي .. #

  
--- # Client Side ! 
        GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
        Column = guiGridListAddColumn(GUIEditor.gridlist[1], "الأسماء", 0.85) 
        GUIEditor.button[1] = guiCreateButton(75, 232, 74, 21, "أختيــار", false, GUIEditor.window[1]) 
         for i = 1, 5 do 
            guiGridListAddRow(GUIEditor.gridlist[1]) 
        end 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "نواف", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "عمر", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "عائشة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "فاطمة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "محمد", false, false) 
        addEventHandler("onClientGUIClick",root, 
        function () 
        if source == GUIEditor.button[1] then 
      local grid = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
      local getgrid = guiGridListGetItemText(GUIEditor.gridlist[1], grid, Column) 
      if not grid or not  getgrid then 
        return 
      end 
      if getgrid == "" then 
        return 
      end 
      triggerServerEvent("setaname", localPlayer, getgrid) 
  end 
end) 
  

  
--- # Server Side ! 
addEventHandler("onResourceStart",resourceRoot, 
function () 
exports.scoreboard:addScoreboardColumn("My Name") 
end) 
addEvent("setaname",true) 
addEventHandler("setaname",root, 
function(player,getgrid) 
if getgrid == "نواف" then 
setElementData(player,"My Name","نواف") 
elseif getgrid == "عمر" then 
setElementData(player,"My Name","عمر") 
elseif getgrid == "عائشة" then 
setElementData(player,"My Name","عائشة") 
elseif getgrid == "فاطمة" then 
setElementData(player,"My Name","فاطمة") 
elseif getgrid == "محمد" then 
setElementData(player,"My Name","محمد") 
end 
end) 
  

مو مجرب .. #

Edited by Guest
Link to comment

هاذي بعد التعديل وركبت النافذه

خطاآء ..

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(273, 203, 232, 263, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "أختر أسم ", 0.9) 
        GUIEditor.button[1] = guiCreateButton(75, 232, 74, 21, "أختيــار", false, GUIEditor.window[1]) 
         for i = 1, 5 do 
            guiGridListAddRow(GUIEditor.gridlist[1]) 
        end 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "نواف", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "عمر", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "عائشة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "فاطمة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "محمد", false, false) 
        addEventHandler("onClientGUIClick",root, 
        function () 
      local grid = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
      local getgrid = guiGridListGetItemText(GUIEditor.gridlist[1], grid, Column) 
      if not grid or not  getgrid then 
        return 
      end 
      if getgrid == "" then 
        return 
      end 
      triggerServerEvent("setaname", localPlayer, getgrid) 
  end 
end) 
  

Link to comment

نفس المشكله

صار سطر 37

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(273, 203, 232, 263, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "أختر أسم ", 0.9) 
        GUIEditor.button[1] = guiCreateButton(75, 232, 74, 21, "أختيــار", false, GUIEditor.window[1]) 
         for i = 1, 5 do 
            guiGridListAddRow(GUIEditor.gridlist[1]) 
        end 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "نواف", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "عمر", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "عائشة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "فاطمة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "محمد", false, false) 
        addEventHandler("onClientGUIClick",root, 
        function () 
        if source == GUIEditor.button[1] then 
      local grid = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
      local getgrid = guiGridListGetItemText(GUIEditor.gridlist[1], grid, Column) 
      if not grid or not  getgrid then 
        return 
      end 
      if getgrid == "" then 
        return 
      end 
      triggerServerEvent("setaname", localPlayer, getgrid) 
  end 
end) 
  

Link to comment

ابو شنب ,

جبت العيد بالبرمجه :lol: ,

بالنسبه لـ ابو فيصل ,

هذا مثال على اسم عمر ,

-- Client Side #

Grid = guiCreateGridList(...) 
Button = guiCreateButton(170, 26, 74, 21, "أختيــار", false) 
local Column = guiGridListAddColumn(Grid, "الأسماء", 0.9) 
local Row = guiGridListAddRow ( Grid ) 
guiGridListSetItemText ( Grid, Row, Column, 'عمر', false, false ) 
  
addEventHandler('onClientGUIClick',Button, 
function() 
    if guiGridListGetSelectedItem ( Grid ) ~= -1 then 
        local Get = guiGridListGetItemText ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) 
            if ( Get ) then 
                triggerServerEvent("ShowInScoreBoard",localPlayer,Get) 
            end 
        end 
    end,false 
) 

-- Server Side #

exports.scoreboard:addScoreboardColumn('My Name') 
  
addEvent('ShowInScoreBoard',true) 
addEventHandler('ShowInScoreBoard',root, 
function( Get ) 
    if ( Get ) then 
        setElementData(client,'My Name',tostring(Get)) 
        end 
    end 
) 

بالنسبه للأسماء سويها جدول تسهل عليك ذذ

Link to comment
  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(273, 203, 232, 263, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "أختر أسم ", 0.9) 
        GUIEditor.button[1] = guiCreateButton(75, 232, 74, 21, "أختيــار", false, GUIEditor.window[1]) 
         for i = 1, 5 do 
            guiGridListAddRow(GUIEditor.gridlist[1]) 
        end 
        guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "نواف", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "عمر", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "عائشة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "فاطمة", false, false) 
        guiGridListSetItemText(GUIEditor.gridlist[1], 4, 1, "محمد", false, false) 
   end 
) 
        addEventHandler("onClientGUIClick",root, 
        function () 
        if source == GUIEditor.button[1] then 
      local grid = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) 
      local getgrid = guiGridListGetItemText(GUIEditor.gridlist[1], grid, Column) 
      if not grid or not  getgrid then 
        return 
      end 
      if getgrid == "" then 
        return 
      end 
      triggerServerEvent("setaname", localPlayer, getgrid) 
  end 
end) 
  

Link to comment

بعد تعديل الكلينت حقك يا ذا بيست

خرب .. بس مدري حتى قبل ماأعدل :) ؟؟

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(273, 203, 232, 263, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
Grid = guiCreateGridList(GUIEditor.gridlist[1]) 
Button = guiCreateButton(170, 26, 74, 21, "أختيــار", false) 
local Column = guiGridListAddColumn(Grid, "الأسماء", 0.9) 
local Row = guiGridListAddRow ( Grid ) 
guiGridListSetItemText ( Grid, Row, Column, 'عمر', false, false ) 
  
addEventHandler('onClientGUIClick',Button, 
function() 
    if guiGridListGetSelectedItem ( Grid ) ~= -1 then 
        local Get = guiGridListGetItemText ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) 
            if ( Get ) then 
                triggerServerEvent("ShowInScoreBoard",localPlayer,Get) 
            end 
        end 
    end,false 
) 
  

Link to comment

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
  
GUIEditor.window[1] = guiCreateWindow(273, 203, 232, 263, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
Grid = guiCreateGridList(GUIEditor.gridlist[1]) 
Button = guiCreateButton(170, 26, 74, 21, "أختيــار", false,GUIEditor.window[1]) 
local Column = guiGridListAddColumn(Grid, "الأسماء", 0.9) 
local Row = guiGridListAddRow ( Grid ) 
guiGridListSetItemText ( Grid, Row, Column, 'عمر', false, false ) 
  
addEventHandler('onClientGUIClick',Button, 
function() 
    if guiGridListGetSelectedItem ( Grid ) ~= -1 then 
        local Get = guiGridListGetItemText ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) 
            if ( Get ) then 
                triggerServerEvent("ShowInScoreBoard",localPlayer,Get) 
            end 
        end 
    end,false 
) 

ما يحتاج حدث + ناقص قوس واند للفنكشن ذذ

Link to comment
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
  
GUIEditor.window[1] = guiCreateWindow(273, 203, 232, 263, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
Grid = guiCreateGridList(GUIEditor.gridlist[1]) 
Button = guiCreateButton(170, 26, 74, 21, "أختيــار", false,GUIEditor.window[1]) 
local Column = guiGridListAddColumn(Grid, "الأسماء", 0.9) 
local Row = guiGridListAddRow ( Grid ) 
guiGridListSetItemText ( Grid, Row, Column, 'عمر', false, false ) 
  
addEventHandler('onClientGUIClick',Button, 
function() 
    if guiGridListGetSelectedItem ( Grid ) ~= -1 then 
        local Get = guiGridListGetItemText ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) 
            if ( Get ) then 
                triggerServerEvent("ShowInScoreBoard",localPlayer,Get) 
            end 
        end 
    end,false 
) 

ما يحتاج حدث + ناقص قوس واند للفنكشن ذذ

اللوحه تفتح

لاكن الزر فووق مخرف !!

مافيه أسم عمر +

Link to comment

انا معطيك مثال وانت زودت عليه ذذ

GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
  
GUIEditor.window[1] = guiCreateWindow(273, 203, 232, 263, "", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 213, 199, false, GUIEditor.window[1]) 
GUIEditor.button[1] = guiCreateButton(75, 232, 74, 21, "أختيــار", false,GUIEditor.window[1]) 
local Column = guiGridListAddColumn(GUIEditor.gridlist[1], "الأسماء", 0.9) 
local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
guiGridListSetItemText ( GUIEditor.gridlist[1], Row, Column, 'عمر', false, false ) 
  
addEventHandler('onClientGUIClick',Button, 
function() 
    if guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ~= -1 then 
        local Get = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) 
            if ( Get ) then 
                triggerServerEvent("ShowInScoreBoard",localPlayer,Get) 
            end 
        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...