-
Posts
573 -
Joined
-
Last visited
-
Days Won
4
Everything posted by #\_oskar_/#
-
مافهمت كودك لانه مو مرتب بس سوي تحقق من السياره اللي انت راكبها والصق فيها الاوبجكت local vehicle = getPedOccupiedVehicle(localPlayer) attachElements(weapon,vehicle)
-
taple = { {km = 100 , dinar = '1'}, {km = 200 , dinar = '2'}, {km = 300 , dinar = '3'}, {km = 400 , dinar = '4'}, {km = 500 , dinar = '5'}, {km = 600 , dinar = '6'}, {km = 700 , dinar = '7'}, {km = 800 , dinar = '8'}, {km = 900 , dinar = '9'}, {km = 1000 , dinar = '10'}, {km = 1100 , dinar = '11'}, {km = 1200 , dinar = '12'}, {km = 1300 , dinar = '13'}, } local start = getTickCount() function monitoring() if(isPlayerInVehicle(getLocalPlayer())) then local now = getTickCount() speed = now - start if speed > 1000 then x,y,z = getElementPosition(getLocalPlayer()) distanceTraveled = distanceTraveled + getDistanceBetweenPoints3D(x,y,z,oX,oY,oZ) sd = math.floor(distanceTraveled) guiSetText(meterlable," " .. sd .. " متر") for k,v in ipairs (taple) do if sd > v.km then guiSetText(GUIEditor.label[4] ,v.dinar .. ' دينار ') end end oX = x oY = y oZ = z start = getTickCount() end end end addEventHandler("onClientRender",getRootElement(),monitoring) سويت لك تحقق من السعر شوف كدا اللي تقصده ولا لا ؟
-
onVehicleStartExit cancelEvent
-
للافاده اليوزفل -- 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
-
يفضل انك تسوي تحقق من المسافه بينك وبين البوابه ب استخدام getDistanceBetweenPoints3D
-
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()
-
Linear بدل ال بـ CosineCurve
-
شوف المود دا في نفس طلبك https://community.multitheftauto.com/index.php?p=resources&s=details&id=3003
-
#Server getPlayerMoney -- تتحق من فلوس اللاعب takePlayerMoney -- اسحب فلوس من اللاعب #Client onClientGUIClick -- حدث الضغط ع الزر triggerServerEvent -- تسوي اتصال من كلنت لسيرفر حاولي تسوي اي شئ واطرح محاولتك
-
what thes function > spawnThePlayer
-
Destroy vehicle only IF vehicles are the specific id's
#\_oskar_/# replied to sevenlwo's topic in Scripting
getElementModel -
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
-
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
-
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)
-
math.min((getTickCount()-tick)/2000,tick ) -- عدد مفتوح or math.min((getTickCount()-tick)/2000,10 ) -- العدد راح يكون 10 مرات ---- اذا في شئ ثاني تفضل قوله
-
if y2 * (515/sy)*1/Nitro < احداثيات اللي تبي توقف عليها then dxDrawImage(....) else removeVehicleUpgrade addVehicleUpgrade or dxDrawImage(....) end سوي حذف للنيتر ثم قم ب ضافته ثاني او تقدر تكمل بنفس الصوره وتخلها بمكان ثابت الي ان يوقف النيترو وترجع الصوره مكانها ثاني مدري فهمتني او لا
-
use dxGetTextWidth
-
سوي تحقق if y2 * (515/sy)*1/Nitro < احداثيات اللي تبي توقف عليها then
-
اضبط الاحداثيات ?
-
لو كتبت بجوجل شرح ل اي وظيفه راح تجيك شروحات عنها او ادخل قسم دروس في البرمجة وانت بتلاقي شروحات بتفيدك ان شاء الله
-
y2 * (515/sy)*1/Nitro مافهمت بشكل واضح بس جرب كدا