Jump to content

طلب فنكشنات [ إحضار مابات معينه


Recommended Posts

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

كيف الحال , عسآكم طيبين

وشسمه لاهنتم ابي فنكشنات يجيب لي أسماء مابات محدده ب قريد لست !

يعني مثلا الماب الي يكون قبل اسمه CW يجيبه فقط

زي نظام التكتيك لما تسوي ماب

عشان يشتغل بالمود الي تبيه تحطه المود اول شيء بعدين اسم الماب

مثال CW-Arena1

انا ابيه يجيب لي المابات الي يكون قبلها زي كذا إن شاء الله فهمتوو :roll:

Link to comment

سويته لكن لما اكتب الكوماند مايضبط !

وهذآ آلي يطلع لي بآلديبوق

Pdva6o7.png

-- Client

function getCwMapsClient () 
guiGridListClear(GUIEditor.gridlist[3]) 
             row = guiGridListAddRow(GUIEditor.gridlist[3]) 
             guiGridListSetItemText(GUIEditor.gridlist[3],row,columns,""..aname.."",false,false) 
            guiGridListSetItemColor ( GUIEditor.gridlist[3], row, 1, 0, 255, 150, 255 ) 
end 
addEvent("getCwMapsTr",true) 
addEventHandler("getCwMapsTr", getRootElement(), getCwMapsClient) 
  
  

-- Server

function getCwMapsServer ( commandName ) 
        for index, resource in ipairs(getResources()) do 
            if getResourceInfo(resource,"type") == "map" then 
             name = getResourceName(resource) 
             if string.find(name,"cw",1) then 
             aname = "cw_"..name 
             triggerClientEvent ("getCwMapsTr", getRootElement() ) 
            end 
        end 
    end 
end 
addCommandHandler( "getcwmaps", getCwMapsServer ) 

Link to comment

addEventHandler ("onClientResourceStart", resourceRoot, function () 
triggerServerEvent ("getMods", localPlayer) 
end 
) 
  
addEvent ("getModsName", true) 
addEventHandler ("getModsName", root, function (mods) 
local row = guiGridListAddRow (grid) 
guiGridListSetItemText (grid, row, 1, mods, false, false) 
end 
) 

Server side #

addEvent ("getMods", true) 
addEventHandler ("getMods", root, function () 
    for _,v in ipairs (getResources ()) do 
        local resName = getResourceName (v) 
        if string.find (resName, "Cw", 1) then 
        triggerClientEvent (source, "getModsName", source, resName) 
        end 
    end 
end 
) 
Link to comment

عندي مشكله في جلب اللاعبين

vFvsSaW.png

x, y, z = 3136, -1014, 2833 
x1, y1, z1 = 3146, -740, 2833 
addEventHandler ("onClientGUIClick", resourceRoot, function (  ) 
      if ( source == GUIEditor.button[9] ) then 
      for _,v in ipairs (getPlayersInTeam(theTeam)) do 
      if ( theTeam == Red ) then 
      setElementPosition ( v, x+math.random(1,10) ,y+math.random(1,10), z) 
      elseif ( theTeam == Blue ) then 
      setElementPosition ( v, x+math.random(1,10) ,y+math.random(1,10), z) 
end 
    end 
        end 
            end) 

Link to comment
    x, y, z = 3136, -1014, 2833 
    x1, y1, z1 = 3146, -740, 2833 
    addEventHandler ("onClientGUIClick", resourceRoot, function (  ) 
          if ( source == GUIEditor.button[9] ) then 
          for _,v in pairs (getPlayersInTeam(theTeam)) do 
          if ( theTeam == Red ) then 
          setElementPosition ( v, x+math.random(1,10) ,y+math.random(1,10), z) 
          elseif ( theTeam == Blue ) then 
          setElementPosition ( v, x+math.random(1,10) ,y+math.random(1,10), z) 
    end 
        end 
            end 
                end) 

Link to comment
team getTeamFromName ( string teamName )

^ ردك مامنه فايده

-- The Best

        x, y, z = 3136, -1014, 2833 
        x1, y1, z1 = 3146, -740, 2833 
        addEventHandler ("onClientGUIClick", resourceRoot, function ( theTeam ) 
              if ( source == GUIEditor.button[9] ) then 
              for _,v in pairs (getPlayersInTeam(theTeam)) do 
              if ( theTeam == Red ) then 
              setElementPosition ( v, x+math.random(1,10) ,y+math.random(1,10), z) 
              elseif ( theTeam == Blue ) then 
              setElementPosition ( v, x+math.random(1,10) ,y+math.random(1,10), z) 
        end 
            end 
                end 
                    end) 

Link to comment

^

ماهو تيم onClientGUIClick اول بارتمر في الأفنت

مو بس تحط اي شي عشوائيا لازم تفهم ايش هو البارتمر الخاص بالأفنت من صفحة الويكي

uWXkCEo.png

+

getPlayersInTeam انت اساساً جايب اللاعبين الي في تيم معين عن طريق الفنكشن

بالتالي المقارنة الي انت مسويها في سطر 6 و 8 ما لها داعي

معرف Red او Blue و ما اعتقد ان عندك متغير بأسم

استخدم ذا

Link to comment

آلمشكله هذي حليتها من امس خلآص !

بس ابي آخلي ناس عندهم داتا معينه يصيرون مشاهدين على لاعبين من فريق انا احدده

زي نظام التكتيك لما تموت تصير مشاهد

او لما تكون ب تيم معين تشوف اللاعبين آيش آلفنكشنات الي احتاجها

Link to comment
هذي معقدهـ شوية بس يمديكـ تسويها
setCameraTarget 
var 
getElementsByType 
getPlayerTeam 
getTeamFromName 
bindKey 
getElementData 

ويمكن تحتاج غيرهـ لان انا ما فهمت %100

طيب انا ابيه مايقدر يصير مشاهد إلا إذآ كتب امر معين !

عشان يقدر يسوي bindKey

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