ميدوح Posted October 23, 2016 Share Posted October 23, 2016 (edited) --- Client.lua addEvent( "Downloadwait", true ) addEventHandler( "Downloadwait", resourceRoot, function( pic ) if myTexture then destroyElement( myTexture ) end myTexture = dxCreateTexture( pic ) end ) rot = 0 addEventHandler("onClientRender", root, function() if myTexture then rot = rot + 0.20 local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture,tocolor(255,255,255),rot ) end end ) --------- ---- server.lua function picClient ( pic, error, player ) if error == 0 then triggerLatentClientEvent ("Downloadwait", 5000, false, player, pic ) end end function urlPic( player ) outputChatBox ( "Download startet ...") fetchRemote ( "https://cdn1.iconfinder.com/data/icons/loading-icon/100/loading_icon-02-256.png", picClient, "", false, player ) end [2016-10-23 14:33:07] WARNING: Access denied @ 'fetchRemote' [string "..."] [2016-10-23 14:33:13] WARNING: cpng\server.lua:10: Access denied @ 'fetchRemote' Edited October 23, 2016 by medo7 Link to comment
iPrestege Posted October 23, 2016 Share Posted October 23, 2016 triggerLatentClientEvent هذي لية مستعملها؟ وماستعملت ترايقر كلاينت عادي؟ وش السبب؟ والخطا انك ماحطيت المود لة صلاحيات حطة في قروب ادمن 1 Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 15 minutes ago, FaHaD said: triggerLatentClientEvent هذي لية مستعملها؟ وماستعملت ترايقر كلاينت عادي؟ وش السبب؟ والخطا انك ماحطيت المود لة صلاحيات حطة في قروب ادمن صح صلحت الخطا شكرا لك بالنسبة triggerLatentClientEvent بيصغر مساحة صور Link to comment
Mr.CoR Posted October 23, 2016 Share Posted October 23, 2016 حياك ادخل الموضوع هذا لو سمحت 2 Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 10 minutes ago, Mr.CoR said: حياك ادخل الموضوع هذا لو سمحت زي Tags Link to comment
AHMED MOSTAFA Posted October 23, 2016 Share Posted October 23, 2016 11 minutes ago, Mr.CoR said: حياك ادخل الموضوع هذا لو سمحت يا كور ابي اعرف شي ليش لازم تكون بالطريقة هاذي + ليش ما كنت تسويها بطريقة افضل مثلاً طلب : طريقة انشاء ماركر استفسار : كيفية اخضار اسم اللاعب مساعدة : اصلاح اكواد انا ما اقصد ان الشكل سئ لكن هاذي وجهة نظر فقط Link to comment
Mr.CoR Posted October 23, 2016 Share Posted October 23, 2016 سويها بالشكل الي انت تبيه بس المهم انك توضح الي داخل موضوعك من العنوان والنموذج الي كتبته انت ممتاز 7 minutes ago, medo7 said: زي Tags لا مو التاق هذي لعنوان الموضوع Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 up setTimer ( removeEventHandler("onClientRender",root,function() getEventHandlers ("onClientRender",root) cancelEvent () end), 1000, 1) ! nil ^ Link to comment
iPrestege Posted October 23, 2016 Share Posted October 23, 2016 وش تبي تسوي؟ وش هالحوسة كلها؟ تبي تشيل الصورة بعد ثانية؟ Link to comment
iPrestege Posted October 23, 2016 Share Posted October 23, 2016 (edited) rot = 0 function aRender ( ) if myTexture then rot = rot + 0.20 local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture,rot ) end end addEventHandler ( 'onClientRender',root,aRender ) setTimer ( removeEventHandler,10000,1,'onClientRender',root,aRender ) جرب هذا بعد عشر ثواني يشيلة Edited October 23, 2016 by FaHaD Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 (edited) شكراك معني getEventHandlers Edited October 23, 2016 by medo7 Link to comment
iPrestege Posted October 23, 2016 Share Posted October 23, 2016 الوظيفة هذي تجيب الاحداث اللي مضافة بنفس الحدث Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 (edited) 1 hour ago, medo7 said: up setTimer ( removeEventHandler("onClientRender",root,function() getEventHandlers ("onClientRender",root) cancelEvent () end), 1000, 1) ! nil ^ الكود تمام ..بس طيب كيف اشيل الصورة نهائيا؟ setTimer ( removeEventHandler,10000,1,'onClientRender',root,aRender ) زي ^ مره Edited October 23, 2016 by medo7 Link to comment
iPrestege Posted October 23, 2016 Share Posted October 23, 2016 استعمل : destroyElement( myTexture ) 1 Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 --- كلنت rot = 0 function aRender ( ) if myTexture then rot = rot + 0.20 local w,h = dxGetMaterialSize( myTexture ) dxDrawImage( 200, 100, w, h, myTexture,rot ) destroyElement( myTexture ) -- FaHaD ^_^ end end addEventHandler ( 'onClientRender',root,aRender ) setTimer ( removeEventHandler,10000,1,'onClientRender',root,aRender ) -- X ! --- function isCursorOverRectangle(x,y,w,h) if isCursorShowing() then local mx,my = getCursorPosition () local ScreenX,ScreenY = guiGetScreenSize() cursorx,cursory = mx*ScreenX,my*ScreenY if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end end local qual = 50 local dim = y/qual local rgb = {} local colors = { [1] = tocolor(255,0,0), [2] = tocolor(0,255,0), [3] = tocolor(0,0,255), } function render() for i = 0, qual*qual do local cA = math.floor(i/qual) local ws = i%qual local colorsA = colors[rgb[i+1]] dxDrawRectangle(ws*dim, cA*dim, dim, dim, colorsA ,false) if isCursorOverRectangle(ws*dim, cA*dim, dim, dim) then for color,_ in ipairs(colors) do if getKeyState(tostring(color)) then rgb[i+1] = color end end end end end addEventHandler("onClientRender", root, render) ابي حفظ صور كيف ^ Link to comment
</Mr.Tn6eL> Posted October 23, 2016 Share Posted October 23, 2016 في حاجة غريبة عندك dxDrawImage( 200, 100, w, h, myTexture,rot ) destroyElement( myTexture ) -- FaHaD ^_^ كيف ترسم بعدين تحذف وكمان جوا الرندر الصورة راح تنرسم بعدين تنحذف مايتحقق الشرط if myTexture then 1 Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 (edited) 9 minutes ago, said: في حاجة غريبة عندك dxDrawImage( 200, 100, w, h, myTexture,rot )destroyElement( myTexture ) -- FaHaD ^_^ كيف ترسم بعدين تحذف وكمان جوا الرندر الصورة راح تنرسم بعدين تنحذف مايتحقق الشرط if myTexture then الثاني ترسم بس كيف حفظ ! fetchRemote ( "https://cdn1.iconfinder.com/data/icons/loading-icon/100/loading_icon-02-256.png", picClient, "", false, player ) Edited October 23, 2016 by medo7 Link to comment
</Mr.Tn6eL> Posted October 23, 2016 Share Posted October 23, 2016 وش دخل هذا بهذا او قصدك في مشكلة بالسطر؟ Link to comment
ميدوح Posted October 23, 2016 Author Share Posted October 23, 2016 شوف فوق ؟؟ مهم ابي حفظ -- im.lua function isCursorOverRectangle(x,y,w,h) if isCursorShowing() then local mx,my = getCursorPosition () local ScreenX,ScreenY = guiGetScreenSize() cursorx,cursory = mx*ScreenX,my*ScreenY if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end end local qual = 50 local dim = y/qual local rgb = {} local colors = { [1] = tocolor(255,0,0), [2] = tocolor(0,255,0), [3] = tocolor(0,0,255), } function render() for i = 0, qual*qual do local cA = math.floor(i/qual) local ws = i%qual local colorsA = colors[rgb[i+1]] dxDrawRectangle(ws*dim, cA*dim, dim, dim, colorsA ,false) if isCursorOverRectangle(ws*dim, cA*dim, dim, dim) then for color,_ in ipairs(colors) do if getKeyState(tostring(color)) then rgb[i+1] = color end end end end end addEventHandler("onClientRender", root, render) كيف حفظ Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now