Jump to content

طلب كود.


Recommended Posts

  • Replies 68
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

شالخطا دا؟

-- ضيف ذذ لوب 
JP = { 
    {"1",'minutes',60000}, 
    {"2",'mintes',120000}, 
    {"3",'mintes',180000}, 
    {"5",'mintes',3000000}, 
    {"10",'mintes',600000}, 
    {"15",'mintes',900000}, 
    {"20",'mintes',1200000}, 
    {"30",'mintes',1800000}, 
    {"40",'mintes',2400000}, 
    {"1",'hours',3600000}, 
    {"2",'hours',7200000}, 
    {"3",'hours',10800000}, 
    {"4",'hours',14400000}, 
    {"5",'hours',18000000}, 
    {"24",'hours',86400000} 
    } 
     
    changeGridListItemToPlayersName = function ( GridList, Column ) 
    if GridList and Column then -- Check Parematers 
        if getElementType ( GridList ) == "gui-gridlist" then -- Check The Type of ' GridList ' 
            if guiGridListClear ( GridList ) then -- Clear GridList 
                for i, v in next, getElementsByType ( "player" ) do -- Get Everything by Type ' player ' 
                    local Row = guiGridListAddRow ( GridList ) -- Add Row 
                    guiGridListSetItemText ( GridList, Row, Column, getPlayerName ( v ), false, false ); -- Set New Values 
                end; -- end of ' for ' 
            end; -- end of ' clear gridlist ' 
        end; -- end of ' check gridlist type ' 
    end; -- end of ' check parematers 
end; 
  
  
GUIEditor = { 
    button = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        wnd = guiCreateWindow(124, 137, 550, 364, ":: Jail Systeam ::", false) 
        guiWindowSetSizable(wnd, false) 
        guiSetVisible (wnd, false)  
        grid2 = guiCreateGridList(10, 24, 258, 253, false, wnd) 
        guiGridListAddColumn(grid2, "Name", 0.9) 
        grid = guiCreateGridList(273, 24, 258, 253, false, wnd) 
        guiGridListAddColumn(grid, "ID", 0.5) 
        guiGridListAddColumn(grid, "Time", 0.5) 
        GUIEditor.button[1] = guiCreateButton(10, 287, 150, 36, "UnJail", false, wnd) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[2] = guiCreateButton(192, 287, 150, 36, "UnJail", false, wnd) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[3] = guiCreateButton(364, 287, 150, 36, "Close", false, wnd) 
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.label[1] = guiCreateLabel(354, 337, 222, 17, "#Created By [L]e3bA | v3.4.1", false, wnd) 
        guiLabelSetColor(GUIEditor.label[1], 229, 0, 0)     
    end 
) 
  
  
  
  
  
  
    guiSetVisible (wnd, false)   
function OpenWin() 
    if guiGetVisible ( wnd ) then 
       guiSetVisible ( wnd, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( wnd, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("m", "down", OpenWin) 
  
  
  
 for _, v in ipairs (JP) do 
local Row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid, Row, 1, v[1], false, false) 
guiGridListSetItemText(grid, Row, 2, v[2], false, false) 
guiGridListSetItemData(grid, Row,1, v[3], false, false) 
end 
  
addEventHandler("onClientGUIClick", GUIEditor.button[1],   
function ( ) 
local sel = guiGridListGetSelectedItem(grid) 
local sel2 = guiGridListGetSelectedItem(grid2) 
local Jail = unpack(guiGridListGetItemData ( grid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

Link to comment
شالخطا دا؟
-- ضيف ذذ لوب 
JP = { 
    {"1",'minutes',60000}, 
    {"2",'mintes',120000}, 
    {"3",'mintes',180000}, 
    {"5",'mintes',3000000}, 
    {"10",'mintes',600000}, 
    {"15",'mintes',900000}, 
    {"20",'mintes',1200000}, 
    {"30",'mintes',1800000}, 
    {"40",'mintes',2400000}, 
    {"1",'hours',3600000}, 
    {"2",'hours',7200000}, 
    {"3",'hours',10800000}, 
    {"4",'hours',14400000}, 
    {"5",'hours',18000000}, 
    {"24",'hours',86400000} 
    } 
     
    changeGridListItemToPlayersName = function ( GridList, Column ) 
    if GridList and Column then -- Check Parematers 
        if getElementType ( GridList ) == "gui-gridlist" then -- Check The Type of ' GridList ' 
            if guiGridListClear ( GridList ) then -- Clear GridList 
                for i, v in next, getElementsByType ( "player" ) do -- Get Everything by Type ' player ' 
                    local Row = guiGridListAddRow ( GridList ) -- Add Row 
                    guiGridListSetItemText ( GridList, Row, Column, getPlayerName ( v ), false, false ); -- Set New Values 
                end; -- end of ' for ' 
            end; -- end of ' clear gridlist ' 
        end; -- end of ' check gridlist type ' 
    end; -- end of ' check parematers 
end; 
  
  
GUIEditor = { 
    button = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        wnd = guiCreateWindow(124, 137, 550, 364, ":: Jail Systeam ::", false) 
        guiWindowSetSizable(wnd, false) 
        guiSetVisible (wnd, false)  
        grid2 = guiCreateGridList(10, 24, 258, 253, false, wnd) 
        guiGridListAddColumn(grid2, "Name", 0.9) 
        grid = guiCreateGridList(273, 24, 258, 253, false, wnd) 
        guiGridListAddColumn(grid, "ID", 0.5) 
        guiGridListAddColumn(grid, "Time", 0.5) 
        GUIEditor.button[1] = guiCreateButton(10, 287, 150, 36, "UnJail", false, wnd) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[2] = guiCreateButton(192, 287, 150, 36, "UnJail", false, wnd) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[3] = guiCreateButton(364, 287, 150, 36, "Close", false, wnd) 
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.label[1] = guiCreateLabel(354, 337, 222, 17, "#Created By [L]e3bA | v3.4.1", false, wnd) 
        guiLabelSetColor(GUIEditor.label[1], 229, 0, 0)     
    end 
) 
  
  
  
  
  
  
    guiSetVisible (wnd, false)   
function OpenWin() 
    if guiGetVisible ( wnd ) then 
       guiSetVisible ( wnd, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( wnd, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("m", "down", OpenWin) 
  
  
  
 for _, v in ipairs (JP) do 
local Row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid, Row, 1, v[1], false, false) 
guiGridListSetItemText(grid, Row, 2, v[2], false, false) 
guiGridListSetItemData(grid, Row,1, v[3], false, false) 
end 
  
addEventHandler("onClientGUIClick", GUIEditor.button[1],   
function ( ) 
local sel = guiGridListGetSelectedItem(grid) 
local sel2 = guiGridListGetSelectedItem(grid2) 
local Jail = unpack(guiGridListGetItemData ( grid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

الكود كله غلط :arrowleft:

Link to comment
  
        grid2 = guiCreateGridList(10, 24, 258, 253, false, wnd) 
        col = guiGridListAddColumn(grid2, "Name", 0.9) 
        -- هنا المفروض يضيف ذذ الفنكشن 
        changeGridListItemToPlayersName (grid2,col) 
         
-- المفروض يحفظ الداتا لو خرج 
-- يعني مثلا اللاعب طلع من سيرفر لازم نحفظ انه من الجيل .. 
  

وبسس اتوقع ذي هي الاخطاء

Link to comment
addEventHandler("onClientGUIClick", Jail,   
function ( ) 
local sel = guiGridListGetSelectedItem(TimeGrid) 
local sel2 = guiGridListGetSelectedItem(grid) 
local Jail = unpack(guiGridListGetItemData ( TimeGrid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

وين الخطأ ؟

الزر لا يعمل

Link to comment
addEventHandler("onClientGUIClick", Jail,   
function ( ) 
local sel = guiGridListGetSelectedItem(TimeGrid) 
local sel2 = guiGridListGetSelectedItem(grid) 
local Jail = unpack(guiGridListGetItemData ( TimeGrid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

وين الخطأ ؟

الزر لا يعمل

انت مسمي الزر Jail ?

addEventHandler("onClientGUIClick", Btn,   
function ( ) 
local sel = guiGridListGetSelectedItem(TimeGrid) 
local sel2 = guiGridListGetSelectedItem(grid) 
local Jail = unpack(guiGridListGetItemData ( TimeGrid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementsByType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

اوك سميه اي اسم ثاني

مثل

Btn

Link to comment

انا غيرت كل شئ على اساس الكود ذه

addEventHandler("onClientGUIClick", GUIEditor.button[1],   
function ( ) 
local sel = guiGridListGetSelectedItem(grid) 
local sel2 = guiGridListGetSelectedItem(grid2) 
local Jail = unpack(guiGridListGetItemData ( grid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

و مازال لا يعمل

ممكن تصليحه ؟

Link to comment

for _, v in ipairs (JP) do 
local Row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid, Row, 1, v[1], false, false) 
guiGridListSetItemText(grid, Row, 2, v[2], false, false) 
guiGridListSetItemData(grid, Row,1, v[3], false, false) 
end 

تاني شي دا

addEventHandler("onClientGUIClick", GUIEditor.button[1],   
function ( ) 
local sel = guiGridListGetSelectedItem(grid) 
local sel2 = guiGridListGetSelectedItem(grid2) 
local Jail = unpack(guiGridListGetItemData ( grid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

لو ما ظبت

اطرج اكوادك

Link to comment
for _, v in ipairs (JP) do 
local Row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid, Row, 1, v[1], false, false) 
guiGridListSetItemText(grid, Row, 2, v[2], false, false) 
guiGridListSetItemData(grid, Row,1, v[3], false, false) 
end 

تاني شي دا

addEventHandler("onClientGUIClick", GUIEditor.button[1],   
function ( ) 
local sel = guiGridListGetSelectedItem(grid) 
local sel2 = guiGridListGetSelectedItem(grid2) 
local Jail = unpack(guiGridListGetItemData ( grid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 

لو ما ظبت

اطرج اكوادك

اولا ! ذه

for _, v in ipairs (JP) do 
local Row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid, Row, 1, v[1], false, false) 
guiGridListSetItemText(grid, Row, 2, v[2], false, false) 
guiGridListSetItemData(grid, Row,1, v[3], false, false) 
end 

انا مسويه و ذه عشان يظهر التيبول ده بالقريد ليست

JP = { 
    {"1 Minute",60000}, 
    {"2 Minutes",120000}, 
    {"3 Minutes",180000}, 
    {"5 Minutes",3000000}, 
    {"10 Minutes",600000}, 
    {"15 Minutes",900000}, 
    {"20 Minutes",1200000}, 
    {"30 Minutes",1800000}, 
    {"40 Minutes",2400000}, 
    {"1 Hour",3600000}, 
    {"2 Hours",7200000}, 
    {"3 Hours",10800000}, 
    {"4 Hours",14400000}, 
    {"5 hours",18000000}, 
    {"24 Hours",86400000} 
    } 

ثانياً انا مسوي الكود الثانى بظبط

Link to comment
واخيراً ^^
  
-- ضيف ذذ لوب 
JP = { 
    {"1",'minutes',60000}, 
    {"2",'mintes',120000}, 
    {"3",'mintes',180000}, 
    {"5",'mintes',3000000}, 
    {"10",'mintes',600000}, 
    {"15",'mintes',900000}, 
    {"20",'mintes',1200000}, 
    {"30",'mintes',1800000}, 
    {"40",'mintes',2400000}, 
    {"1",'hours',3600000}, 
    {"2",'hours',7200000}, 
    {"3",'hours',10800000}, 
    {"4",'hours',14400000}, 
    {"5",'hours',18000000}, 
    {"24",'hours',86400000} 
    } 
  
changeGridListItemToPlayersName = function ( GridList, Column ) 
    if GridList and Column then -- Check Parematers 
        if getElementType ( GridList ) == "gui-gridlist" then -- Check The Type of ' GridList ' 
            if guiGridListClear ( GridList ) then -- Clear GridList 
                for i, v in next, getElementsByType ( "player" ) do -- Get Everything by Type ' player ' 
                    local Row = guiGridListAddRow ( GridList ) -- Add Row 
                    guiGridListSetItemText ( GridList, Row, Column, getPlayerName ( v ), false, false ); -- Set New Values 
                end; -- end of ' for ' 
            end; -- end of ' clear gridlist ' 
        end; -- end of ' check gridlist type ' 
    end; -- end of ' check parematers 
end; 
  
GUIEditor = { 
    button = {} 
} 
        wnd = guiCreateWindow(121, 135, 525, 333, "#", false) 
        guiWindowSetSizable(wnd, false) 
  
        grid = guiCreateGridList(12, 55, 227, 268, false, wnd) 
        col1 = guiGridListAddColumn(grid, "ID", 0.5) 
        col2 = guiGridListAddColumn(grid, "Time", 0.5) 
        grid2 = guiCreateGridList(259, 55, 227, 268, false, wnd) 
        col3 = guiGridListAddColumn(grid2, "Name", 0.9) 
        changeGridListItemToPlayersName ( grid2, col3) 
        GUIEditor.button[1] = guiCreateButton(116, 26, 238, 24, "Jail", false, wnd) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")     
  
  
  
  
  
  
    guiSetVisible (wnd, false)   
function OpenWin() 
    if guiGetVisible ( wnd ) then 
       guiSetVisible ( wnd, false ) 
       showCursor(false) 
       guiSetInputEnabled(false) 
    else 
        guiSetVisible ( wnd, true ) 
        showCursor(true) 
        guiSetInputEnabled(true) 
  
    end 
end 
bindKey("m", "down", OpenWin) 
  
  
for _, v in ipairs (JP) do 
local Row = guiGridListAddRow(grid) 
guiGridListSetItemText(grid, Row, 1, v[1], false, false) 
guiGridListSetItemText(grid, Row, 2, v[2], false, false) 
guiGridListSetItemData(grid, Row,1, v[3], false, false) 
end 
  
addEventHandler("onClientGUIClick", GUIEditor.button[1],   
function ( ) 
local sel = guiGridListGetSelectedItem(grid) 
local sel2 = guiGridListGetSelectedItem(grid2) 
local Jail = unpack(guiGridListGetItemData ( grid,sel,1 )) 
local Mk = setElementPosition ( 2122.21818, 53121, 10.5141 ) 
setElementPosition ( 2122.21338, 2243.54175, 10.67188 ) 
if  sel ~= -1 and sel2 ~= -1 and  getElementType(player) == "player"  then 
setTimer ( Jail , Mk ) 
end 
end) 
  

اتمنى تكون انك فاهم كل شيء ^^

انشالله بتستفيد

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