Jump to content

* طلب أكواد -


N3xT

Recommended Posts

  • Replies 67
  • Created
  • Last Reply

Top Posters In This Topic

addEvent ( "addMaps_", true ) 
addEventHandler ( "addMaps_", root, function ( m_table ) 
    guiGridListClear ( GUIEditor.gridlist[1] ) 
    cMaps = m_table 
    for _,v in ipairs ( m_table ) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
  end 
end ) 
  
addEventHandler("onClientGUIChanged",root, 
function () 
    if ( source == GUIEditor.edit[1] ) then 
    local text = string.upper(guiGetText(GUIEditor.edit[1])) 
    if ( text == "" ) then return     
else 
    guiGridListClear(GUIEditor.gridlist[1]) 
    for i,v in ipairs(cMaps) do 
    if ( string.find ( string.upper ( v ), string.upper ( guiGetText ( GUIEditor.edit[1]) ) ) ) then 
    if string.find(text) then 
    local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,getPlayerName(v),false,false) 
    guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,100,100) 
else 
return 
end 
end 
end 
end 
end 
end 
end 
) 

Link to comment
addEvent ( "addMaps_", true ) 
addEventHandler ( "addMaps_", root, function ( m_table ) 
    guiGridListClear ( GUIEditor.gridlist[1] ) 
    cMaps = m_table 
    for _,v in ipairs ( m_table ) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
  end 
end ) 
  
addEventHandler("onClientGUIChanged",root, 
function () 
    if ( source == GUIEditor.edit[1] ) then 
    local text = string.upper(guiGetText(GUIEditor.edit[1])) 
    if ( text == "" ) then return     
else 
    guiGridListClear(GUIEditor.gridlist[1]) 
    for i,v in ipairs(cMaps) do 
    if ( string.find ( string.upper ( v ), string.upper ( guiGetText ( GUIEditor.edit[1]) ) ) ) then 
    if string.find(text) then 
    local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,getPlayerName(v),false,false) 
    guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,100,100) 
else 
return 
end 
end 
end 
end 
end 
end 
end 
) 

وش تخربط أنت ؟

Link to comment
addEvent ( "addMaps_", true ) 
addEventHandler ( "addMaps_", root, function ( m_table ) 
    guiGridListClear ( GUIEditor.gridlist[1] ) 
    cMaps = m_table 
    for _,v in ipairs ( m_table ) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
  end 
end ) 
  
addEventHandler("onClientGUIChanged",root, 
function () 
    if ( source == GUIEditor.edit[1] ) then 
    local text = string.upper(guiGetText(GUIEditor.edit[1])) 
    if ( text == "" ) then return     
else 
    guiGridListClear(GUIEditor.gridlist[1]) 
    for i,v in ipairs(cMaps) do 
    if ( string.find ( string.upper ( v ), string.upper ( guiGetText ( GUIEditor.edit[1]) ) ) ) then 
    if string.find(text) then 
    local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,getPlayerName(v),false,false) 
    guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,100,100) 
else 
return 
end 
end 
end 
end 
end 
end 
end 
) 

وش تخربط أنت ؟

خلي يجربه أول !

Link to comment
addEvent ( "addMaps_", true ) 
addEventHandler ( "addMaps_", root, function ( m_table ) 
    guiGridListClear ( GUIEditor.gridlist[1] ) 
    cMaps = m_table 
    for _,v in ipairs ( m_table ) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
  end 
end ) 
  
addEventHandler("onClientGUIChanged",root, 
function () 
    if ( source == GUIEditor.edit[1] ) then 
    local text = string.upper(guiGetText(GUIEditor.edit[1])) 
    if ( text == "" ) then return     
else 
    guiGridListClear(GUIEditor.gridlist[1]) 
    for i,v in ipairs(cMaps) do 
    if ( string.find ( string.upper ( v ), string.upper ( guiGetText ( GUIEditor.edit[1]) ) ) ) then 
    if string.find(text) then 
    local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,getPlayerName(v),false,false) 
    guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,255,100,100) 
else 
return 
end 
end 
end 
end 
end 
end 
end 
) 

guiGridListSetItemText(GUIEditor.gridlist[1],row,1,getPlayerName(v),false,false) 

:| مَ يحتاج أجربه

Link to comment

Bad Argument #1 to 'upper' (string expected, got boolean) : سطر 109

addEventHandler("onClientGUIChanged",root, 
function () 
    if ( source == GUIEditor.edit[1] ) then 
        local text = string.upper(guiGetText(GUIEditor.edit[1])) 
        local row = guiGridListAddRow(GUIEditor.gridlist[1]) 
              if ( text == "" ) then return     
                else 
                    guiGridListClear(GUIEditor.gridlist[1]) 
                for i,v in ipairs(cMaps) do 
                if ( string.find ( string.upper ( v ) , string.upper ( guiGetText ( GUIEditor.edit[1]) ) ) ) then 
                if string.find(text) then 
                    guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v,false, false) 
                end 
                end 
                end 
                end 
    end 
end) 

Link to comment

-- Client Side  
  
addEvent ( "addMaps_", true ) 
addEventHandler ( "addMaps_", root, function ( m_table ) 
    guiGridListClear ( GUIEditor.gridlist[1] ) 
    cMaps = m_table 
    for _,v in ipairs ( m_table ) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
  end 
end ) 
  
  
addEventHandler ( "onClientGUIChanged", GUIEditor.edit[1],  
     function (  ) 
    if ( guiGetText ( GUIEditor.edit[1] ) ~= "" ) then 
      guiGridListClear ( GUIEditor.gridlist[1] ) 
      for _,v in ipairs ( cMaps ) do 
      local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
       if ( string.find ( string.upper ( v ), string.upper ( guiGetText ( GUIEditor.edit[1]) , 1, true ) ) ) then 
            guiGridListSetItemText( GUIEditor.gridlist[1], row, 1, v, false, false ) 
        end 
      end 
  else 
      guiGridListClear ( GUIEditor.gridlist[1] ) 
      for _,v in ipairs ( cMaps ) do 
          local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
          guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
    end 
  end 
end ,false 
  ) 
Link to comment

آمم جرب كذآ

-- Client Side 
  
addEvent ( "addMaps_", true ) 
addEventHandler ( "addMaps_", root, function ( m_table ) 
    guiGridListClear ( GUIEditor.gridlist[1] ) 
    cMaps = m_table 
    for _,v in ipairs ( m_table ) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
  end 
end ) 
  
  
addEventHandler ( "onClientGUIChanged", GUIEditor.edit[1], 
     function (  ) 
    if ( guiGetText ( GUIEditor.edit[1] ) ~= "" ) then 
      guiGridListClear ( GUIEditor.gridlist[1] ) 
      for _,v in ipairs ( cMaps ) do 
      local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
       local ResourceName = getResourceName ( v ) 
       if ( string.find ( string.upper ( ResourceName ), string.upper ( guiGetText ( GUIEditor.edit[1]) , 1, true ) ) ) then 
            guiGridListSetItemText( GUIEditor.gridlist[1], row, 1, ResourceName , false, false ) 
        end 
      end 
  else 
      guiGridListClear ( GUIEditor.gridlist[1] ) 
      for _,v in ipairs ( cMaps ) do 
          local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
          local ResourceName = getResourceName ( v ) 
          guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, ResourceName , true, true) 
    end 
  end 
end ,false 
  ) 
Link to comment

م ظبط ,

للمعلومية ، تراني حاط بالقريد ليست

getResourceInfo( v, "name" ) 

عشان يحط لي أسم المابات واقدر احطها نكست

getResourceName 

م ينفع

مَ فيه يعني احد يعرف لها ولا كيف

Link to comment
الحين انت وش تبي تسوي بالظبط ؟

تبي في الايديت يوم تبحث ؟

ووش الخطأ ذا الي في الديبوق ؟

يوم كتبت طلع الخطأ ؟ + اطرح كود الكلاينت الاخير

الي ركبته

عندي أديت ، وأبيه يبحث عن المابات

وذا أخر كود ركبته

addEvent ( "addMaps_", true ) 
addEventHandler ( "addMaps_", root, function ( m_table ) 
    guiGridListClear ( GUIEditor.gridlist[1] ) 
    cMaps = m_table 
    for _,v in ipairs ( m_table ) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, v, true, true) 
  end 
end ) 
  
  
addEventHandler ( "onClientGUIChanged", GUIEditor.edit[1], 
     function (  ) 
    if ( guiGetText ( GUIEditor.edit[1] ) ~= "" ) then 
      guiGridListClear ( GUIEditor.gridlist[1] ) 
      for _,v in ipairs ( cMaps ) do 
      local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
       local ResourceName = getResourceName ( v ) 
       if ( string.find ( string.upper ( ResourceName ), string.upper ( guiGetText ( GUIEditor.edit[1]) , 1, true ) ) ) then 
            guiGridListSetItemText( GUIEditor.gridlist[1], row, 1, ResourceName , false, false ) 
        end 
      end 
  else 
      guiGridListClear ( GUIEditor.gridlist[1] ) 
      for _,v in ipairs ( cMaps ) do 
          local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
          local ResourceName = getResourceName ( v ) 
          guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, ResourceName , true, true) 
    end 
  end 
end ,false 
  ) 

getResourceNameهنا البحث يكون عن طريق

انا مخليه

getResourceInfo - عشان يطلع أسمه من الميتا

واذا كتبت شيء بالاديت يطلع الخطأ

bad argument #1 to 'upper' (string expected, got boolean

Link to comment

طيب سويته لك بطريقه مختلفه شويتين جربها :

Client side #

addEventHandler ("onClientResourceStart", resourceRoot,  
  function () 
    triggerServerEvent ("GetMaps", localPlayer) 
  end 
) 
  
addEventHandler ("onClientGUIClick", resourceRoot,  
  function () 
    if (source == GUIEditor.button[2]) then 
      local row = guiGridListGetSelectedItem (GUIEditor.gridlist[1]) 
      local select = guiGridListGetItemText (GUIEditor.gridlist[1], row, 1) 
      if (select and select ~= "") then 
        triggerServerEvent ("nextM", localPlayer, select) 
      end 
    end 
  end 
) 
  
addEvent ("addMaps_", true) 
addEventHandler ("addMaps_", root,  
  function (maps) 
    guiGridListClear (GUIEditor.gridlist[1]) 
    for _,v in ipairs (maps) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, v, false, false) 
    end 
  end 
) 
  
addEventHandler ("onClientGUIChanged", GUIEditor.edit[1], 
  function () 
    if guiGetText (source) ~= "" then 
      guiGridListClear (GUIEditor.gridlist[1]) 
      triggerServerEvent ("searchForIt", localPlayer, guiGetText (source)) 
    else 
      triggerServerEvent ("getMapsBack", localPlayer) 
    end 
  end 
) 
  
addEvent ("ReplyFromServer", true) 
addEventHandler ("ReplyFromServer", root,  
  function (mapName, maps) 
    for _,v in ipairs (maps) do 
      if string.find (v:lower (), mapName:lower ()) then 
        local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
        guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, v, false, false) 
      end 
    end 
  end 
) 
  
addEvent ("getAllMaps", true) 
addEventHandler ("getAllMaps", root,  
  function (maps)  
    for _,v in ipairs (maps) do 
      local row = guiGridListAddRow (GUIEditor.gridlist[1]) 
      guiGridListSetItemText (GUIEditor.gridlist[1], row, 1, v, false, false) 
    end 
  end 
) 

Server side #

function fetchMaps (  ) 
   local Maps_ = {   } 
   for k, v in ipairs( getResources (  ) ) do 
    if ( getResourceInfo( v, "type" ) == "map" and getResourceInfo( v, "gamemodes" ) == "race" )then 
         table.insert ( Maps_, getResourceName( v ) ) 
     end 
   end 
  return Maps_ 
end 
  
addEvent ("GetMaps", true) 
addEventHandler ("GetMaps", root,  
  function () 
    local Maps = fetchMaps () 
    triggerClientEvent (source, "addMaps_", source, Maps) 
  end 
) 
  
addEvent ("searchForIt", true) 
addEventHandler ("searchForIt", root,  
  function (mapName) 
    local maps = fetchMaps () 
    triggerClientEvent (source, "ReplyFromServer", source, mapName, maps) 
  end 
) 
  
addEvent ("getMapsBack", true) 
addEventHandler ("getMapsBack", root,  
  function () 
    local maps = fetchMaps () 
    triggerClientEvent (source, "getAllMaps", source, maps) 
  end 
) 
  
addEvent ("nextM", true) 
addEventHandler ("nextM", root,  
  function (map) 
    executeCommandHandler ("nextmap", source, map) 
  end 
) 
Link to comment

الكود ظبط بالبحث وتمام ، بس فيه مشكلة

getResourceName( v ) 

الأسماء اللي بالقريد ليست ، أسماء ملفات الماب فهمتني ؟

أنا أبيه يطلع لي أسماء المابات اللي بالميتا

getResourceInfo( v, "name" ) 

اذا عدلت عليه وخليته كذا يخرب وما اقدر ابحث وش الحل

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