Jump to content

SycroX

Members
  • Posts

    2,141
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by SycroX

  1. 3 hours ago, Debo15 said:

    هاي الوظيفة بترجعلك المتغيرات الي حطتهم على شكل جدول على حسب الكود بس له اكثر من استخدام 

    ما اظن يفيدك 

    هذا لمكاتب الدي اكس

    بستخدم كثير على حسب علمي

    ](*,)](*,)

    تشوفني مبتداء ؟

    واضح جدا ان المقصد مزاح لا اكثر

    الكود كامل تقدر تختصره بذي فقط

    +

    بدل 

    sum(1,2,3,4)

    1+2+3+4

    و كمان الكود في غلطات حتي يعني :-

    • Confused 1
  2. 20 hours ago, *RayaN-Alharbi. said:

    كيمرا

    تبي تسوي وحش براس اسد و زيل ثعبان ؟؟ هههه

    6 hours ago, #_iMr,[E]coo said:
    
    dxCreateScreenSource
    

     

    ذي تجيب كاميرا اللاعب المحلي .. ما ينفع يستخدمها

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

     

  3. 23 hours ago, KillerX said:

     مب معرف the player الخطا هنا 

    +

    الافضل تسوي التحقق بتايمر مشان لو حد خد رتبة كونسل اثناء ما السكريبت شغال الزراير بتكون مقفولة لازم تايمر

    server Side

    
    function CheckConsole(  )
        for _ , v in ipairs( getElementsByType( 'player' ) )do
            if ( isObjectInACLGroup( 'user.' .. getAccountName( getPlayerAccount( v ) ) , aclGetGroup( 'Console' ) ) ) then
                triggerClientEvent( v , 'open' , v , true )
            else
                triggerClientEvent( v , 'open' , v , false )
            end
        end
    end
    
    setTimer( CheckConsole , 1000 , 0 )      
           
    

    Client Side : 

    
    GUIEditor = {button = { } , window = { } } 
    
    GUIEditor.window[2] = guiCreateWindow ( 0 , 0 , 0.5 , 0.4 , "لوحة القوانين", true )
    GUIEditor.button[2] = guiCreateButton( 0 , 0 , 0.5 , 0.4 , "*[ إضافة قانون ]*", true , GUIEditor.window[2] )
    
    addEvent( 'open' , true )
    addEventHandler( 'open' , root , 
        function( bool )
        	guiSetEnabled( GUIEditor.button[2] , bool and true or false ) 
        end
    )   
    

     

    و ليه التايمر و انت تقدر تتحقق كل ما اللاعب يفتح اللوحه افضل لتجنب استهلاك المعالج

    boolean و سطر 9 يكفي تحط المتغير فقط لانه اصلا قيمته 

    رائ لا غير 

    • Like 1
  4. 13 minutes ago, Mr.Mostafa said:

    مب فاهم شي من كودك , ولا ادري وش فكرة كودك الصراحة

    مثلا لو عندك جدول كذا

    MyFevChars = { "jasper", "hale", "alice", "edward", "bella", "1", "twillight", "izombie", "liv", "moore", "carlaiyal" }

    و تبي تحفظه في روو واحد في قاعد بيانات تقدر تستخدم

    toJSON, fromJSON

    عشان تحفظه و تجيب بياناته بدل ما تسوي لكل واحده رو خاص

  5. 1 minute ago, Master_MTA said:

    حبيبي تسلم لكن الفكره مش هنا انا ممكن اعمله لو ل 1 جريد لست

    لكن انا عايز اعمله لاي جريد لست

    لول

    فعشان كده عايزه نسبة وتناسب هوا ده اللي بكلم فيه لكن عالعموم تسلم

    ❤️

     

    اها معلش فهمت غلط , مش مشكله خلاص واي فاي عمل الواجب معك 

    :D

     

    • Like 1
  6. local testTable = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}
    local scrollLevel = 0
    local currentLevel = 0
    local totalRows = 7
    local selected = {}
    local addedValue = 0
    function isMouseInPosition ( x, y, width, height )
    	if ( not isCursorShowing( ) ) then
    		return false
    	end
        local sx, sy = guiGetScreenSize ( )
        local cx, cy = getCursorPosition ( )
        local cx, cy = ( cx * sx ), ( cy * sy )
        if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
            return true
        else
            return false
        end
    end
    addEventHandler("onClientRender", root,
        function()
            dxDrawRectangle(0, 240, 800, 121, tocolor(0, 0, 0, 150), false)
    		local tableSize = #testTable
    		if tableSize > totalRows then
    			scrollLevel = (tableSize/totalRows)-1
    			if scrollLevel > math.floor((tableSize/totalRows)-1) then
    				scrollLevel = scrollLevel + 1
    			end
    		end
    		if currentLevel == 0 then
    			local startIndex = 1
    			local endIndex = totalRows
    			for index = startIndex, endIndex do
    				if testTable[index] and testTable[index] ~= nil then
    					if isMouseInPosition(20+((index-1)*107)+addedValue, 250, 107, 101) or (selected[1] == 20+((index-1)*107)+addedValue and selected[2] == 250 and selected[3] == 107 and selected[4] == 101) then
    						dxDrawRectangle(20+((index-1)*107)+addedValue, 250, 107, 101, tocolor(0, 0, 0, 150), false)
    						dxDrawText(tostring(testTable[index]), 20+((index-1)*107), 250, 127+(((index-1)*107)), 350, tocolor(150, 150, 150, 255), 1.00, "default", "center", "center", false, false, false, false, false)
    					else
    						dxDrawRectangle(20+((index-1)*107)+addedValue, 250, 107, 101, tocolor(62, 194, 68, 150), false)
    						dxDrawText(tostring(testTable[index]), 20+((index-1)*107), 250, 127+(((index-1)*107)), 350, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
    					end
    				end
    			end
    		elseif currentLevel > 0 then
    			local startIndex = currentLevel*totalRows+1
    			local endIndex = (currentLevel+1)*totalRows
    			for index = startIndex, endIndex do
    				local drawIndex = index-(totalRows*currentLevel)
    				if testTable[index] and testTable[index] ~= nil then
    					if isMouseInPosition(20+((drawIndex-1)*107), 250, 107, 101) or (selected[1] == 20+((drawIndex-1)*107) and selected[2] == 250 and selected[3] == 107 and selected[4] == 101) then
    						dxDrawRectangle(20+((drawIndex-1)*107), 250, 107, 101, tocolor(200, 200, 200, 150), false)
    						dxDrawText(tostring(testTable[index]), 20+((drawIndex-1)*107), 250, 127+(((drawIndex-1)*107)), 350, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)
    					else
    						dxDrawRectangle(20+((drawIndex-1)*107), 250, 107, 101, tocolor(62, 194, 68, 150), false)
    						dxDrawText(tostring(testTable[index]), 20+((drawIndex-1)*107), 250, 127+(((drawIndex-1)*107)), 350, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false)				
    					end
    				end
    			end
    		end
        end
    )
    
    bindKey("a", "down",
    	function()
    		currentLevel = currentLevel - 1
    		if currentLevel < 0 then
    			currentLevel = scrollLevel
    		end
    	end
    )
    
    bindKey("d", "down",
    	function()
    		currentLevel = currentLevel + 1
    		if currentLevel > scrollLevel then
    			currentLevel = 0
    		end
    	end
    )
    
    addEventHandler("onClientClick", root,
    	function(b,s)
    		if b == "left" and s == "down" then
    			selected = {}
    			local startIndex, endIndex
    			if currentLevel > 0 then
    				startIndex = currentLevel*totalRows+1
    				endIndex = (currentLevel+1)*totalRows
    			else
    				startIndex = 1
    				endIndex = totalRows
    			end
    			for index = startIndex, endIndex do
    				local drawIndex
    				if currentLevel > 0 then
    					drawIndex = index-(totalRows*currentLevel)
    				else
    					drawIndex = index
    				end
    				if testTable[index] and testTable[index] ~= nil then
    					if isMouseInPosition(20+((drawIndex-1)*107), 250, 107, 101) then
    						selected = {20+((drawIndex-1)*107), 250, 107, 101}
    					end
    				end
    			end
    		end
    	end
    )

    بص هو واي فاي ساعدك بس صراحه مش عايز امسح الي كتبته ?

    فذا مثال كنت مسويه زمان لما كنت بحاول اسوي  جريدليست بس بالعرض عشان احط فيه صور و كذا

    بما اني معتزل قلت ممكن يفيدك او تاخد منه فكره اسهل عن السكرول بار

    • Thanks 1
  7. 4 minutes ago, Master_MTA said:

    سلام عليكم شباب كيف الحال

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

    لكن مشكلة السكرول بار حق القريد لست تعبتني فابي حل للمساله الحسابيه ذي

    صوره للتوظيح

    p_986t3cwq1.png

     

    وضح اكتر اقدر اساعدك في الحساب

  8. اليوم الخميس كنت فاضي حوالي ساعه فما كان في شي اسويه فسويته لك حظك بقا  بس ما كملته  خلي الشباب يكملوه لك

    local Races, FinishMarker, MarkerBlip = {
        ["Players"] = {},
        ["Cars"] = {},
        ["State"] = "Stopped",
        ["EndPosition"] = {0, 0, 0},
        ["WarpPosition"] = {
            {0, 0, 0},
            {0, 0, 0},
            {0, 0, 0}
        },
        ["Time"] = 10,
        ["Command"] = "سباق",
    }, nil, nil
    
    function isPlayerInRace(p)
        if p and isElement(p) then
            return Races["Players"][p]
        end
        return false 
    end
    
    addEventHandler("onResourceStart", resourceRoot,
        function()
            startRace()
        end
    )
    
    function startRace()
        for _,player in ipairs(getElementsByType("player")) do
            outputChatBox("Server races started, type ' "..Races["Command"].." ' in the chat to join the race", player, 255, 255, 0, true)
        end
        Races["State"] = "Waiting"
        FinishMarker = createMarker(Races["EndPosition"][1], Races["EndPosition"][2], Races["EndPosition"][3], "checkpoint", 3, 255, 255, 0, 100)
        MarkerBlip = createBlip(Races["EndPosition"][1], Races["EndPosition"][2], Races["EndPosition"][3], 1)
        BeginTimer = setTimer(
            function()
                for _,player in pairs(Races["Players"]) do
                    outputChatBox("Race has begin, first one to reach the finish line will win the race", player, 255, 0, 0, true)
                    if isElement(Races["Cars"][player]) then
                        setElementFrozen(Races["Cars"][player], false)
                        setElementCollisionsEnabled(Races["Cars"][player], false)
                    end
                end
                Races["State"] = "Started"
            end
        ,5*60000, 1)
    end
    
    addEventHandler("onPlayerChat", root,
        function(text)
            if Races["State"] == "Waiting" then
                if not isPlayerInRace(source) then
                    if not isPedDead(source) then
                        if isPedInVehicle(source) then
                            removePedFromVehicle(source)
                        end
                        if isElement(Races["Cars"][source]) then
                            destroyElement(Races["Cars"][source])
                            Races["Cars"][source] = nil
                        end
                        setElementPosition(source, unpack(Races["WarpPosition"][math.random(#Races["WarpPosition"])]))
                        Races["Cars"][source] = createVehicle(411, unpack(Races["WarpPosition"][math.random(#Races["WarpPosition"])]))
                        setElementFrozen(Races["Cars"][source], false)
                        setElementCollisionsEnabled(Races["Cars"][source], false)
                        Races["Players"][source] = true
                    end
                end
            end
        end
    )

    او كمله انت 

    • Like 3
×
×
  • Create New...