Professional Posted August 24, 2015 Share Posted August 24, 2015 السلام عليكم ابي فنكشن لو كتبت باف 8 شيئ يحط صوره بنصف الشاشه ويخلي كل الاعبين ما تتحرك وكان يصير بطيئ لحتى فكه انا بنفس الكلمه Link to comment
iMr.SFA7 Posted August 24, 2015 Share Posted August 24, 2015 addCommandHandler guiCreateStaticImage triggerServerEvent triggerClientEvent getElementsByType -- Loop setElementFrozen Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 addCommandHandler guiCreateStaticImage triggerServerEvent triggerClientEvent getElementsByType -- Loop setElementFrozen addCommandHandler ( "v" , function () guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", true ) triggerServerEvent("hassan", localPlayer ) end ) addEvent ( "hassan" , true ) addEventHandler ( "hassan" , root, function () for _,v in ipairs ( getElementsByType ( "player" ) ) do setElementFrozen ( v , true ) else setElementFrozen ( v , false ) triggerClientEvent ( source , "hassan1" , source ) end end ) ------------------------ addEvent ( "hassan1" , true ) addEventHandler ( "hassan1" , root, function () guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) end ) Link to comment
iMr.SFA7 Posted August 24, 2015 Share Posted August 24, 2015 -- Server Side addCommandHandler ( "v" , function () for _,v in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent(v,"hassan", v ) setElementFrozen ( v , true ) else setElementFrozen ( v , false ) end end ) -- Client Side addEvent ( "hassan" , true ) addEventHandler ( "hassan" , root, function () guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) end ) Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 -- Server Side addCommandHandler ( "v" , function () for _,v in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent(v,"hassan", v ) setElementFrozen ( v , true ) else setElementFrozen ( v , false ) end end ) -- Client Side addEvent ( "hassan" , true ) addEventHandler ( "hassan" , root, function () guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) end ) بس ابي صوره في نصف Link to comment
iMr.SFA7 Posted August 24, 2015 Share Posted August 24, 2015 https://wiki.multitheftauto.com/wiki/CenterWindow Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 -- Server Side addCommandHandler ( "v" , function () for _,v in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent(v,"hassan", v ) setElementFrozen ( v , true ) else setElementFrozen ( v , false ) end end ) -- Client Side addEvent ( "hassan" , true ) addEventHandler ( "hassan" , root, function () guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) end ) كيف else? وما فيه if ? Link to comment
; Mr.T76eM # Posted August 24, 2015 Share Posted August 24, 2015 الكود خاطئ --server used = true addCommandHandler('command', function () for _,v in ipairs ( getElementsByType ( "player" ) ) do if used then setElementFrozen ( v , true ) triggerClientEvent("event",v) used = false else triggerClientEvent (v,"event2",v) setElementFrozen(v,false) used = true end end end ) --client local w,h = guiGetScreenSize() img = guiCreateStaticImage((w-167) /2 ,(h - 132) /2, 167, 132, "image.png", false) guiSetVisible(img,false) addEvent("event",true) addEventHandler("event",root, function ( ) guiSetVisible(img,true) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) guiSetVisible(img,false) end ) Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 الكود خاطئ --server used = true addCommandHandler('command', function () for _,v in ipairs ( getElementsByType ( "player" ) ) do if used then setElementFrozen ( v , true ) triggerClientEvent("event",v) used = false else triggerClientEvent (v,"event2",v) setElementFrozen(v,false) used = true end end end ) --client local w,h = guiGetScreenSize() img = guiCreateStaticImage((w-167) /2 ,(h - 132) /2, 167, 132, "image.png", false) guiSetVisible(img,false) addEvent("event",true) addEventHandler("event",root, function ( ) guiSetVisible(img,true) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) guiSetVisible(img,false) end ) تمت الافاده بس ابي بس الكونسل Link to comment
The Killer Posted August 24, 2015 Share Posted August 24, 2015 function # getPlayerAccount getAccountName isObjectInACLGroup Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 قصدي اذا كان كونسل يفتح الوحه وكمان اذا كان كونسل ما يصرله شيئ بس للاعب العادي تطلعله الصوره واقدر احط صوره متحركه ؟؟ Link to comment
; Mr.T76eM # Posted August 24, 2015 Share Posted August 24, 2015 The Killer عطاك الفنكشنات الي تحتاجها Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 function () local acc = getPlayerAccount(source) getAccountName ( acc ) getAccountName ( getPlayerAccount ( acc ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) ) then end end ) Link to comment
; Mr.T76eM # Posted August 24, 2015 Share Posted August 24, 2015 function () local acc = getPlayerAccount(source) getAccountName ( acc ) getAccountName ( getPlayerAccount ( acc ) ) if ( isObjectInACLGroup ("user."..accName, aclGetGroup ( "VIP" ) ) ) then end end ) انت توريني وش سويت ولا وش ؟ جرب طيب ._. + الصورة المتحركه https://wiki.multitheftauto.com/wiki/DxDrawGifImage Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 ما ظبط يقلي الدي بوق local w,h = guiGetScreenSize() wait = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) guiSetVisible(wait,false) addEvent("event",true) addEventHandler("event",root, function ( ) guiSetVisible(wait,true) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) guiSetVisible(wait,false) end ) Link to comment
; Mr.T76eM # Posted August 24, 2015 Share Posted August 24, 2015 server used = true addCommandHandler('command', function ( player ) for _,v in ipairs ( getElementsByType ( "player" ) ) do if not (isObjectInACLGroup("user."..getAccountName(getPlayerAccount(v)),aclGetGroup("Console"))) then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Console")) then if used then setElementFrozen ( v , true ) triggerClientEvent("event",v) used = false else triggerClientEvent (v,"event2",v) setElementFrozen(v,false) used = true end else outputChatBox("access denied ",player,255,0,0) end end end end ) Link to comment
; Mr.T76eM # Posted August 24, 2015 Share Posted August 24, 2015 ما ظبطيقلي الدي بوق local w,h = guiGetScreenSize() wait = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) guiSetVisible(wait,false) addEvent("event",true) addEventHandler("event",root, function ( ) guiSetVisible(wait,true) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) guiSetVisible(wait,false) end ) ضع هذا الكود بـ أول الكلينت function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) }, false ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData, false ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData, false ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end ) Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 ما ظبطيقلي الدي بوق local w,h = guiGetScreenSize() wait = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) guiSetVisible(wait,false) addEvent("event",true) addEventHandler("event",root, function ( ) guiSetVisible(wait,true) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) guiSetVisible(wait,false) end ) ضع هذا الكود بـ أول الكلينت function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) }, false ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData, false ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData, false ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end ) function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) }, false ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData, false ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData, false ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end ) local w,h = guiGetScreenSize() wait = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) guiSetVisible(wait,false) addEvent("event",true) addEventHandler("event",root, function ( ) guiSetVisible(wait,true) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) guiSetVisible(wait,false) end ) Link to comment
; Mr.T76eM # Posted August 24, 2015 Share Posted August 24, 2015 guiSetVisible ? هذا الفنكشن Dx كيف تستخدم فنكشنات GUI Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 guiSetVisible ? هذا الفنكشن Dx كيف تستخدم فنكشنات GUI يعني اي فنكشن استعمل ؟ Link to comment
iMr.SFA7 Posted August 24, 2015 Share Posted August 24, 2015 تأكد من مسار الصورة وأنها مضافة للميتا addEventHandler removeEventHandler Link to comment
Professional Posted August 24, 2015 Author Share Posted August 24, 2015 function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) }, false ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData, false ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData, false ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end ) local w,h = guiGetScreenSize() Dx = dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) removeEventHandler("onClientRender",root,Dx) addEvent("event",true) addEventHandler("event",root, function ( ) addEventHandler("onClientRender",root,Dx) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) if removeEventHandler("onClientRender",root,Dx) then removeEventHandler("onClientRender",root,Dx) end end ) رجعت المشكله ذي Link to comment
iMr.SFA7 Posted August 24, 2015 Share Posted August 24, 2015 function dxDrawGifImage ( x, y, w, h, path, iStart, iType, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, startID = iStart, imgID = iStart, imgType = iType, speed = effectSpeed, tick = getTickCount ( ) }, false ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for index, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if ( fileExists ( gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) ) then gifData.imgID = gifData.imgID setElementData ( gif, "gifData", gifData, false ) else gifData.imgID = gifData.startID setElementData ( gif, "gifData", gifData, false ) end end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, gifData.imgPath .."".. gifData.imgID ..".".. gifData.imgType ) end end end ) function Dx () dxDrawGifImage(0, 0, 800, 600, "wait.gif", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEvent("event",true) addEventHandler("event",root, function ( ) addEventHandler("onClientRender",root,Dx) end ) addEvent("event2",true) addEventHandler("event2",root, function ( ) removeEventHandler("onClientRender",root,Dx) end ) 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