Jump to content

yasin0

Members
  • Posts

    171
  • Joined

  • Last visited

Posts posted by yasin0

  1. setTimer ( function ( source )
    if getElementData( source, "onMission" ) == true and playersIntoMission < 1 then
    OutPut ( "✱⌠ ! لم تبدأ مهمة الركض لعدم توفر اللاعبين ⌡✱", root, 255, 0, 0, true )
    killPed ( source )
    setElementData( source, "onMission", false )
    playersIntoMission = 0
    MissionStart ()
    return end
    end
    end, 3000, 1 )

     

  2. ipairs و pairs

    pairs : افضل لما تكون عندك قيم في التيبل واجد مثلا حافظ اكثر من 15 الف قيمة

    ipairs : افضل في حالة انو معك قيم صغيرة

    مثلا جدول فيه 100 قيمة راح يكون الفرق pairs و ipairs 3.41E-07  ثانية

    يعني ipairs  لانو القيم اللي حافظها قليلة افضل بناحية 0.0000000341 ثانية

    مثلا :

    1000 قيمة

    الاسرع : ipairs

    100 الف قيمة

    الأسرع : pairs

     

    الخلاصة ipairs افضل في حالة مامعك قيم كثيرة

    و pairs اسرع في حال معك قيم كثيرة

    • Like 1
  3. 18 hours ago, TOUNSI | ا̍ڸــڛۣــ؏ــٰٱ̍دہ said:

    لا طبعا انا اول ما تعرفت علي اشكال مثلك صرت اهياط حتى بالحمام

    ?

    اهينك على العيون

    ?

    اللعبة انتهت مب مثل اول ترا ثاني شيء مفتخر بنفسك انك مبرمج مثلا ؟ اللغة ماتعتبر برمجة بذاك الزود اللعبة بس تركيب وظايف ماتعتمد على اللغة بشكل كبير واذا تبي تكون مبرمج فعلا تعلم سي بلس واشياء تفيدك وبس

  4. 20 hours ago, Abdul KariM said:

    جرب هذا

    
    --server side
    addEventHandler('onPlayerLogin',root,
    
    	function (	)
    
    	if getPlayerSerial ( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' then 
    
    	setElementData( source ,'serial', true )
    
    		end 
    	end
    	)
    	
    
    	function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)
    				local x, y, z = getElementPosition(TheElement)
    				local x2, y2, z2 = getElementPosition(localPlayer)
    				local distance = distance or 20
    				local height = height or 1
    				local width = width or 1
                                    local checkBuildings = checkBuildings or true
                                    local checkVehicles = checkVehicles or false
                                    local checkPeds = checkPeds or false
                                    local checkObjects = checkObjects or true
                                    local checkDummies = checkDummies or true
                                    local seeThroughStuff = seeThroughStuff or false
                                    local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
                                    local ignoredElement = ignoredElement or nil
    				if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
    					local sx, sy = getScreenFromWorldPosition(x, y, z+height)
    					if(sx) and (sy) then
    						local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
    						if(distanceBetweenPoints < distance) then
    							dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
    						end
    					end
    			end
    	end
    	
    	tag = dxCreateTexture("admin.png")
    	
    addEventHandler("onClientPreRender",root,
    
    	function (	)
    	
    	for k,v in ipairs ( getElementsByType ( "player" ) ) do
    	
    	if getElementData ( v ,'serial' ) == true then
    	
    	dxDrawImageOnElement( v , tag )
    	
    			end
    		end
    	end 
    	)
    	
    	
    	
    	
    	
    	
    	
    	
    	
    

     

    يعطيك العافية سؤال : اشرح لي كيف سويته ووش اخطائي

  5. 14 hours ago, Debo15 said:

    جرب بطريقة التريقر 

    هي تسوي لاق اقل 

    
    --server side
    addEventHandler( 'onPlayerLogin' , root , 
    function()
    	if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then 
    		triggerClientEvent ( root , 'showTag', source )
    	end
    end
    )
    --client side
    function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)
    	local x, y, z = getElementPosition(TheElement)
    	local x2, y2, z2 = getElementPosition(localPlayer)
    	local distance = distance or 20
    	local height = height or 1
    	local width = width or 1
        local checkBuildings = checkBuildings or true
    	local checkVehicles = checkVehicles or false
    	local checkPeds = checkPeds or false
    	local checkObjects = checkObjects or true
    	local checkDummies = checkDummies or true
    	local seeThroughStuff = seeThroughStuff or false
    	local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
    	local ignoredElement = ignoredElement or nil
    	if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
    		local sx, sy = getScreenFromWorldPosition(x, y, z+height)
    		if(sx) and (sy) then
    			local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
    			if(distanceBetweenPoints < distance) then
    				dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
    			end
    		end
    	end
    end
    
    tag = dxCreateTexture( 'admin.png' )
    
    addEvent( 'showTag' , true )
    function showTag ( )
    	dxDrawImageOnElement( source , tag , 20 , 30 , 30 )
    end
    addEventHandler( 'showTag' , root , showTag )
    
    	
    	
    

    الكود مو مجرب

    مايشتغل مع عدم وجود اخطاء

  6. 1 hour ago, Debo15 said:
    
    --server side
    addEventHandler( 'onPlayerLogin' , root , 
    function()
    	if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then 
    		setElementData( source , 'showTag' )
    	end
    end
    )
    --client side
    function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)
    	local x, y, z = getElementPosition(TheElement)
    	local x2, y2, z2 = getElementPosition(localPlayer)
    	local distance = distance or 20
    	local height = height or 1
    	local width = width or 1
        local checkBuildings = checkBuildings or true
    	local checkVehicles = checkVehicles or false
    	local checkPeds = checkPeds or false
    	local checkObjects = checkObjects or true
    	local checkDummies = checkDummies or true
    	local seeThroughStuff = seeThroughStuff or false
    	local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
    	local ignoredElement = ignoredElement or nil
    	if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
    		local sx, sy = getScreenFromWorldPosition(x, y, z+height)
    		if(sx) and (sy) then
    			local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
    			if(distanceBetweenPoints < distance) then
    				dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
    			end
    		end
    	end
    end
    tag = dxCreateTexture( 'admin.png' )
    addEventHandler( 'onClientPreRender' , root , 
    function ( )
        for k , v in ipairs( getElementsByType("player") ) do
    		isSuperPlayer = getElementData( localPlayer , 'showTag' )
    		if ( isSuperPlayer ) then 
    			dxDrawImageOnElement( v , tag )
    		end
    	end
    end
    )
    
    	
    	
    

    على اساس ما فيها خطأ dxDrawImageOnElement  انا ما شفت اكواد وظيفة 

     (so Ez جرب الاكواد( مشكلتك 

    لا تظهر الصورة كما يوجد ارجمنت ناقص وهو الداتا يقول الثالث none

  7. تفضل

    _serial = getPlayerSerial
    _tp = redirectPlayer
    function _onPlayerJoin()
    if _serial(source) == 'سيريالك' then 
    outputChatBox('Welcome To Server Programming',root,255,255,255,true)
    else 
    _tp(source,'ip',port)
    end end 
    addEventHandler('onPlayerJoin',root,_onPlayerJoin)

     

×
×
  • Create New...