Jump to content

* طلب أكواد -


N3xT

Recommended Posts

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_, getResourceInfo( v, "name" ) ) 
     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
  • Replies 67
  • Created
  • Last Reply

Top Posters In This Topic

كيف ما تقدر تبحث ؟

انا شغال عندي ويبحث ومافيه مشاكل !

اذا رجعته على

getResourceName 

يبحث ، واذا غيرته للأسم اللي بالميتا م يبحث

Link to comment

انت لا تعدله بس انسخه وحطه زي كذا:

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 
) 

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_, getResourceInfo( v, "name" ) ) 
     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
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 

يب هنا

Link to comment
طيب تقدر تطرح اكوادك كامله مع اللوحه وهذي ؟

لأن انا عندي يبحث لو غيرتها ولا ما غيرتها ونفس الاكواد

برسلها لك ع الخاص

Link to comment
* يغلق تمت الإفادة .

شكراً : لكل من ساعدني

العفو ... وش كان الغلط :fadein:

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

:mrgreen:

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