Jump to content

#\_oskar_/#

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by #\_oskar_/#

  1. onVehicleStartExit cancelEvent
  2. للافاده اليوزفل -- Color function SetButtonColor(element,property,r,g,b) if getElementType(element) == 'gui-button' then guiSetProperty(element , property, string.format("%.2X%.2X%.2X%.2X",r,g,b,255)) end end -- button function buttonDx(element,x_,y_,w_,h_) s = 1 x, y, w, h = x_,y_,w_,h_ dxDrawRectangle(x, y, w, h, tocolor(6, 137, 244, 200), false) buttonLine = tocolor(7,7,7, 255) dxDrawLine(x - 1, y - 1, x - 1, h+y, buttonLine, s, false) dxDrawLine(w+x, y - 1, x - 1, y - 1,buttonLine, s, false) dxDrawLine(x - 1, h+y, w+x, h+y, buttonLine, s, false) dxDrawLine(w+x, h+y, w+x, y - 1, buttonLine, s, false) local r, g, b = getColorFromString("#"..guiGetProperty(element, "NormalTextColour")) dxDrawText(guiGetText (element), x,y, w+x, h+y,tocolor(r,g,b, 255), 1,"default-bold", "center", "center", false, false, false, false, false) end -- Window function WindowDx(element,x, y, w, h) s = 7 guiWindowSetSizable(element, false) dxDrawRectangle(x, y, w, h, tocolor(255, 255, 255, 200), false) dxDrawRectangle(x, y, w, 20%h, tocolor(9,9,9,255) , false) WindowLine = tocolor(7,7,7, 255) dxDrawLine(x - 1, y - 2, x - 1, h+y, WindowLine, s, false) dxDrawLine(w+x, y + 20, x - 1, y + 20,WindowLine, s, false) dxDrawLine(w+x, y + 2, x - 1, y - 1,WindowLine, s, false) dxDrawLine(x - 3, h+y, w+x+3, h+y, WindowLine, s, false) dxDrawLine(w+x, h+y, w+x, y - 1, WindowLine, s, false) dxDrawText(guiGetText (element), x,y, w+x, 20%h+y, tocolor(255,255,255, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) end -- Image function ImageDx(x_, y_, w_, h_,guiStaticImage) colorl = tocolor(7,7,7, 255) x, y, w, h = x_,y_,w_,h_ dxDrawImage (x, y, w, h,guiStaticImage..'.png', 0, 0, 0 ) s = 1.5 dxDrawLine(x - 1, y - 1, x - 1, h+y, colorl, s, false) dxDrawLine(w+x, y - 1, x - 1, y - 1,colorl, s, false) dxDrawLine(x - 1, h+y, w+x, h+y, colorl, s, false) dxDrawLine(w+x, h+y, w+x, y - 1, colorl, s, false) end -- Position function GetPosition(n) X,Y = guiGetPosition(n , false) w,h = guiGetSize (n , false ) -- guiMoveToBack( n ) guiSetAlpha(n, 0) return X,Y ,w,h end addEventHandler( "onClientMouseEnter",getResourceGUIElement(getThisResource()),function () SetButtonColor(source,'NormalTextColour',200, 200, 200) end) addEventHandler( "onClientMouseLeave",getResourceGUIElement(getThisResource()),function () SetButtonColor(source,'NormalTextColour',110 , 110, 110) end) addEventHandler( "onClientGUIMouseDown", getResourceGUIElement(getThisResource()),function () SetButtonColor(source,'NormalTextColour',110 , 110, 110) end) addEventHandler( "onClientGUIMouseUp", getResourceGUIElement(getThisResource()),function () SetButtonColor(source,'NormalTextColour',200, 200, 200) end) اكواد اللوحه --- Gui Element local screenW, screenH = guiGetScreenSize() Wind = guiCreateWindow((screenW - 849) / 2, (screenH - 364) / 2, 849, 364, "Food", false) guiWindowSetSizable(Wind, false) staticimage1 = guiCreateStaticImage(9, 27, 266, 247, "images/1.png", false, Wind) staticimage2 = guiCreateStaticImage(291, 27, 266, 247, "images/2.png", false, Wind) staticimage3 = guiCreateStaticImage(573, 27, 266, 247, "images/3.png", false, Wind) Hamburger = guiCreateButton(9, 279, 266, 48, "Hamburger 300$", false, Wind) Shawrma = guiCreateButton(291, 279, 266, 48, "Shawrma 200$", false, Wind) Potato = guiCreateButton(573, 279, 266, 48, "Potato 100$", false, Wind) Close = guiCreateButton(9, 327, 830, 25, "X Close X", false, Wind) --- color Button for k,element in ipairs(getElementsByType('gui-button',getResourceGUIElement(getThisResource()))) do SetButtonColor(element,'NormalTextColour',110 , 110, 110) end guiSetVisible(Wind,false ) --- Create dx addEventHandler("onClientRender",root,function () if ( guiGetVisible (Wind) == true ) then local x, y, w, h = GetPosition(Wind) WindowDx(Wind,x, y, w, h) buttonDx(Hamburger,x+9, y+279, 266, 48) buttonDx(Shawrma,x+291, y+279, 266, 48) buttonDx(Potato,x+573, y+279, 266, 48) buttonDx(Close,x+9, y+330, 830, 25) ImageDx(x+9, y+29, 266, 247,"images/1") ImageDx(x+291, y+29, 266, 247,"images/2") ImageDx(x+573, y+29, 266, 247,"images/3") end end) bindKey( "x", "down",function( ) guiSetVisible(Wind,not guiGetVisible( Wind)) showCursor( guiGetVisible( Wind)) end) addEventHandler ( "onClientGUIClick",root, function ( ) if source == Close then guiSetVisible(Wind,false) showCursor( false) end end) او ممكن تحمله download-zip تفتح اللوحه حرف x
  3. يفضل انك تسوي تحقق من المسافه بينك وبين البوابه ب استخدام getDistanceBetweenPoints3D
  4. شيل الرتب الموجوده بالاوامر
  5. function refreshList() guiGridListClear(gridListDoar) for _, player in ipairs(getElementsByType("player")) do local rowDoar = guiGridListAddRow(gridListDoar) guiGridListSetItemText(gridListDoar, rowDoar, colunaDoar, getPlayerName(player), false, false) guiGridListSetItemColor(gridListDoar, rowDoar, colunaDoar, 0, 255, 145) end end addEventHandler ("onClientPlayerChangeNick",root,refreshList) addEventHandler ( "onClientPlayerJoin",root,refreshList) addEventHandler ( "onClientPlayerQuit",root,refreshList) refreshList()
  6. شوف المود دا في نفس طلبك https://community.multitheftauto.com/index.php?p=resources&s=details&id=3003
  7. #Server getPlayerMoney -- تتحق من فلوس اللاعب takePlayerMoney -- اسحب فلوس من اللاعب #Client onClientGUIClick -- حدث الضغط ع الزر triggerServerEvent -- تسوي اتصال من كلنت لسيرفر حاولي تسوي اي شئ واطرح محاولتك
  8. what thes function > spawnThePlayer
  9. اطرح كود الشادر |
  10. TitlesTable = {} function getTitlesTable(text) table.insert(TitlesTable, {text=text or ''}) end addEvent("get:TitlesTable",true) addEventHandler("get:TitlesTable",root,getTitlesTable) addEventHandler("onClientRender",root,function () for i, k in ipairs(TitlesTable) do dxDrawRelativeRectangle(598, 219+i*30, 296, 30, isMouseInPosition((598/resolutionX )*sWidth,((219+i*30)/resolutionY )*sHeight, (219/resolutionX )*sWidth, (32/resolutionY )*sHeight) and tocolor(255, 255, 255, 158) or tocolor(0, 0, 0, 158)) dxDrawRelativeText(k.text, 701, 200+i*30, 785+40, 239+(i+1)*30, tocolor(255, 255, 255, 255), 0.40, dxfont5_bebas_font, "left", "center") end end) function getTitlesTable(text,to) return triggerClientEvent (to,'get:TitlesTable',root,text) end Meta.xml <export function="getTitlesTable" type="client" /> <export function="getTitlesTable" type="server" /> example
  11. local text1 = 'Rank Up !' local text2 = 'Mugger' local scale = 2.50 local font = "pricedown" local x,y,w,h = 10,500,300, 66 ----- addEventHandler("onClientRender", root,function() local offset = dxGetFontHeight(scale,font) local w1 = dxGetTextWidth(text1..'\n'..text2,scale,font) dxDrawRectangle(x,y-offset,w+w1-295,h+offset, tocolor(0, 0, 0,197), false) dxDrawText(text1..'\n'..text2,x,y-offset,w+x,h+y,tocolor(237, 174, 3, 212),scale,font, "left", "center", false, false, false, true, false) end) #Edit
  12. local text1 = 'Rank Up !' local text2 = 'Mugger' local scale = 1 local font = "pricedown" local x,y,w,h = 10, 500,300, 66 ----- addEventHandler("onClientRender", root,function() local w1 = dxGetTextWidth(text1..'\n'..text2,scale,font) dxDrawRectangle(x,y,w+w1-295,h, tocolor(0, 0, 0,197), false) dxDrawText(text1..'\n'..text2,x,y,w+x,h+y,tocolor(237, 174, 3, 212),scale,font, "left", "center", false, false, false, true, false) end)
  13. math.min((getTickCount()-tick)/2000,tick ) -- عدد مفتوح or math.min((getTickCount()-tick)/2000,10 ) -- العدد راح يكون 10 مرات ---- اذا في شئ ثاني تفضل قوله
  14. if y2 * (515/sy)*1/Nitro < احداثيات اللي تبي توقف عليها then dxDrawImage(....) else removeVehicleUpgrade addVehicleUpgrade or dxDrawImage(....) end سوي حذف للنيتر ثم قم ب ضافته ثاني او تقدر تكمل بنفس الصوره وتخلها بمكان ثابت الي ان يوقف النيترو وترجع الصوره مكانها ثاني مدري فهمتني او لا
  15. سوي تحقق if y2 * (515/sy)*1/Nitro < احداثيات اللي تبي توقف عليها then
  16. لو كتبت بجوجل شرح ل اي وظيفه راح تجيك شروحات عنها او ادخل قسم دروس في البرمجة وانت بتلاقي شروحات بتفيدك ان شاء الله
  17. y2 * (515/sy)*1/Nitro مافهمت بشكل واضح بس جرب كدا
  18. onClientRender setTime setWeather weather ID
  19. function createCircle(text,posX,posY,radius,startAngle,stopAngle,color,Sezi) dxDrawCircle(posX,posY,radius, 0,360, tocolor(0,0,0,255), tocolor(0,0,0,255)) dxDrawCircle (posX,posY,radius+Sezi,startAngle,stopAngle,color,tocolor(255,255,255,255),nil, 1) dxDrawCircle(posX,posY, radius, 0,360, tocolor(0,0,0,255), tocolor(0,0,0,255)) dxDrawText(text,posX-30,posY-4,radius+posX,radius+posY,color) end ---- #Code addEventHandler("onClientRender", root, function () local Vehs = getPedOccupiedVehicle(localPlayer) local nitros = getVehicleNitroLevel(Vehs) or 0 if Vehs and nitros then createCircle(math.ceil(nitros*100).."% Nitro",500,400,50,1,nitros/2*725,tocolor(0,5,255,255),5) -- Health Car local Health = getElementHealth (Vehs) Healths = math.ceil(Health/10) createCircle(Healths.."% Health",800,400,50,1,(Health-250)/2,tocolor(0,255,0,255),5) if Healths < 50 then createCircle(Healths.."% Health",800,400,50,1,(Health-250)/2,tocolor(255,0,0,255),5) end end end) قصدك كدا ؟
  20. بالتوفيق لك كمان يا احمد ان شاء الله اضيفه ♥
×
×
  • Create New...