Jump to content

Mr.Mostafa

Members
  • Posts

    1,377
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Mr.Mostafa

  1. ما فهمت الشرح مرة الحين انا اضيف دي للميتا - باسم المود ولا وش؟ <export function="setPlayerScoreboardForced" type="server"/>
  2. السلام عليكم - دا مود الكتابة فوق الراس ابي اسوي له اكسبورت كيف ؟ -- -- dxCreateRoundedTexture -- https://github.com/Pioruniasty/MTA_rounded_rectangle -- https://forum.multitheftauto.com/viewtopic.php?f=108&t=96096 -- Author: Piorun -- All credits of this function to him -- function dxCreateRoundedTexture(text_width,text_height,radius) assert(text_width,"Missing argument 'text_width' at dxCreateRoundedTexture") assert(text_height,"Missing argument 'height' at dxCreateRoundedTexture") assert(radius,"Missing argument 'radius' at dxCreateRoundedTexture") if type(text_width) ~= "number" then outputDebugString("Bad argument @ 'dxCreateRoundedTexture' [Excepted number at argument 1, got " .. type(text_width) .. "]",2) return false end if type(text_height) ~= "number" then outputDebugString("Bad argument @ 'dxCreateRoundedTexture' [Excepted number at argument 2, got " .. type(text_height) .. "]",2) return false end if type(radius) ~= "number" then outputDebugString("Bad argument @ 'dxCreateRoundedTexture' [Excepted number at argument 3, got " .. type(radius) .. "]",2) return false end if text_width < 0 then outputDebugString("text_width can't be less than 0",1) return false end if text_height < 0 then outputDebugString("text_height can't be less than 0",1) return false end if radius < 0 or radius > 100 then outputDebugString("Parameter 'radius' can't be between 0 and 100",1) return false end local texture = DxTexture(text_width,text_height) local pix = texture:getPixels() radius = (radius * (text_height / 2)) / 100 for x=0,text_width do for y=0,text_height do if x >= radius and x <= text_width - radius then dxSetPixelColor(pix,x,y,255,255,255,255) end if y >= radius and y <= text_height - radius then dxSetPixelColor(pix,x,y,255,255,255,255) end if math.sqrt((x - radius)^2 + (y - radius)^2) < radius then dxSetPixelColor(pix,x,y,255,255,255,255) -- lewy gorny rog end if math.sqrt((x - (text_width - radius))^2 + (y - radius)^2) < radius then dxSetPixelColor(pix,x,y,255,255,255,255) -- prawy gorny rog end if math.sqrt((x - radius)^2 + (y - (text_height - radius))^2) < radius then dxSetPixelColor(pix,x,y,255,255,255,255) -- lewy dolny rog end if math.sqrt((x - (text_width - radius))^2 + (y - (text_height - radius))^2) < radius then dxSetPixelColor(pix,x,y,255,255,255,255) -- prawy dolny rog end end end texture:setPixels(pix) return texture end local selfVisible = true -- Want to see your own message? local messages = {} -- {text, player, lastTick, alpha, yPos} local textures = {} local timeVisible = 8500 local distanceVisible = 30 local bubble = true -- Rounded rectangle(true) or not(false) function addBubble(text, player, tick) if (not messages[player]) then messages[player] = {} end local width = dxGetTextWidth(text:gsub("#%x%x%x%x%x%x", ""), 1, "default-bold") local _texture = dxCreateRoundedTexture(width+16,20,100) table.insert(messages[player], {["text"] = text, ["player"] = player, ["tick"] = tick, ["endTime"] = tick + 2000, ["alpha"] = 0, ["texture"] = _texture}) end function removeBubble() table.remove(messages) end addEvent("onChatIncome", true) addEventHandler("onChatIncome", root, function(message, messagetype) if source ~= localPlayer then addBubble(message, source, getTickCount()) elseif selfVisible then addBubble(message, source, getTickCount()) end end ) -- outElastic | Got from https://github.com/EmmanuelOga/easing/blob/master/lib/easing.lua local pi = math.pi function outElastic(t, b, c, d, a, p) if t == 0 then return b end t = t / d if t == 1 then return b + c end if not p then p = d * 0.3 end local s if not a or a < math.abs(c) then a = c s = p / 4 else s = p / (2 * pi) * math.asin(c/a) end return a * math.pow(2, -10 * t) * math.sin((t * d - s) * (2 * pi) / p) + c + b end addEventHandler("onClientRender", root, function() local tick = getTickCount() local x, y, z = getElementPosition(localPlayer) for _, pMessage in pairs(messages) do for i, v in ipairs(pMessage) do if isElement(v.player) then if tick-v.tick < timeVisible then local px, py, pz = getElementPosition(v.player) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) < distanceVisible and isLineOfSightClear ( x, y, z, px, py, pz, true, not isPedInVehicle(v.player), false, true) then v.alpha = v.alpha < 200 and v.alpha + 5 or v.alpha local bx, by, bz = getPedBonePosition(v.player, 6) local sx, sy = getScreenFromWorldPosition(bx, by, bz) local elapsedTime = tick - v.tick local duration = v.endTime - v.tick local progress = elapsedTime / duration if sx and sy then if not v.yPos then v.yPos = sy end local width = dxGetTextWidth(v.text:gsub("#%x%x%x%x%x%x", ""), 1, "default-bold") --local yPos = interpolateBetween ( v.yPos, 0, 0, sy - 22*i, 0, 0, progress, "OutElastic") local yPos = outElastic(elapsedTime, v.yPos, ( sy - 22*i ) - v.yPos, duration, 5) if bubble then dxDrawImage ( sx-width/2-10, yPos - 16, width+16, 20, v.texture, nil, nil, tocolor(0, 0, 0, v.alpha) ) else dxDrawRectangle(sx-width/2-10, yPos - 16, width+16, 20, tocolor(0, 0, 0, v.alpha)) end dxDrawText(v.text, sx-width/2-2, yPos - 14, width, 20, tocolor( 255, 255, 255, v.alpha+50), 1, "default-bold", "left", "top", false, false, false, true) end end else table.remove(messages[v.player], i) end else table.remove(messages[v.player], i) end end end end ) function outputMessage(element, text) assert(isElement(element), "outputMessage @ Bad argument: expected element at argument 1, got "..type(element).." "..tostring(element)) triggerClientEvent("onChatIncome", element, tostring(text)) end function sendMessageToClient(message,messagetype) if not wasEventCancelled() then if messagetype == 0 or messagetype == 2 then triggerClientEvent("onChatIncome", source, message, messagetype) end end end addEventHandler("onPlayerChat",getRootElement(),sendMessageToClient) <meta> <info author="Sasuke*" type="script" name="Bubble chat" version="1.2.2" /> <oop>true</oop> <script src="round.lua" type="client" /> <script src="client.lua" type="client" /> <script src="server.lua" type="server" /> <export function="outputMessage" type="server"/> </meta>
  3. ابي لما شخص يسجل دخولة اللوحة تظهر له - لكن لو ضغط زر معين - لما يسجل مرة اخري ما عادت تظهر له
  4. addEvent("datta",true) addEventHandler("datta",root, function () setAccountData(getPlayerAccount(source),'Data1','true')---هنا لو ضغط زر عدم الاظظهار اللوحة ما تظهر له تاني outputChatBox ( "* System : #ffffff تم الغاء اظهار اللوحة لك مرة ثانية",source,255,0,0,true ) end ) addEventHandler("onPlayerLogin", root, function() local data = getAccountData(getPlayerAccount(source),'Data1' ) if ( data == "true" ) then return end triggerClientEvent(source,'firstlogin',source)---دا مسوي لما شخص يسجل اللوحة تظهر له end ) وش الخطا هنا ؟
  5. قواعد البيانات معقدة مرة ما اعرف لها + حاولت للاكونت داتا بس خرب المود ض1 جربتها ولكن خرب المود !
  6. سلام عليكم الحين انا ابي اسوي لو شخص سجل دخولة تظهر له لوحة لكن لو ظهرت له اللوحة وضغط زر معين - اللوحة ما ترجع تظهر له تاني لما يسجل وسويت الاكواد وكل شي تمام - لكن المشكلة لما اسجل دخولي من /login اللوحة ما تظهر وكل شي تمام - لكن لما اسوي ريكونكت اللوحة تظهر - هل الداتا تختفي بعد الريكونكت ولا كودي خطا ؟ addEvent("datta",true) addEventHandler("datta",root, function () setElementData( source, 'oooo22', 'true' )---هنا لو ضغط زر عدم الاظظهار اللوحة ما تظهر له تاني outputChatBox ( "* System : #ffffff تم الغاء اظهار اللوحة لك مرة ثانية",source,255,0,0,true ) end ) addEventHandler("onPlayerLogin", root, function() local data = getElementData( source, 'oooo22' ) if ( data == "true" ) then return end triggerClientEvent(source,'firstlogin',source)---دا مسوي لما شخص يسجل اللوحة تظهر له end )
  7. local xRoot = getRootElement() xOld = { } function xGetOldPlayerName ( ) local xName = getPlayerName ( source ) local xSerial = getPlayerSerial(source) if getPlayerSerial ( source ) == "سيريال الصاحب" then return end if xOld[tostring(xSerial)] then if xOld[tostring(xSerial)] ~= xName then local xOldName = xOld[tostring(xSerial)] outputChatBox("#FFFFFF[ #FF0000"..xName.."#FFFFFF ]#2B60DE<==(The Name Back)==>#FFFFFF[ #FF0000"..xOldName.."#FFFFFF ]", root, 255, 255, 0, true) xOld[xSerial] = xName end else xOld[xSerial] = xName end end addEventHandler ( "onPlayerJoin", xRoot, xGetOldPlayerName ) جرب
  8. كدا ولا خطا setAccountData( 'Data1', 'true' )
  9. طيب مافي طريقة تانية غير السكل ؟ لاني ما اعرف له
  10. مب مهم جداول ممكن نستخدم اعتقد or
  11. سلام عليكم انا مسوي لوحة - لما شخص يسجل تظهرلة - وسويت زر فيها ابي لو واحد ضغط الزر االلوحة ما عادت تظهر له تاني فا سويت set/getElementData لكن المشكلة لما اكون جوا السيرفر واسوي logout و login تظهر مرة اضغط الزر ما تظهر تاني لكن اسوي ريكونكت تظهر تاني set/getElementData فا هل الــ يختفوا او ينلغوا لما شخص يسوي ريكونكت؟؟
  12. آطرح آكوآد آلمود ولو تبي تسويهآ آنت getPlayerSerial
  13. زي ما قلت سوي لو ضغطت علي الزر الاول - يخفي القريد ليست التاني والتالت ويسوي اظهار للقريد ليست الاول guiSetVisible ( grid, false )----- شيل كلمة قريد وحط اسم القريد + ---- + false يعني يخفي ---- + true يعني يظهر
  14. سلام عليكم سوي ال 4 button وسوي لو ضغطت علي button القريد ليست الاول يختفي والتاني يظهر وهكذا ..
  15. GUIEditor = { button = {}, window = {}, label = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.memo[1] = guiCreateMemo(45, 58, 475, 346, "وشكرا", false, GUIEditor.window[1]) local font0_seguisym = guiCreateMemo(":guieditor/fonts/se.ttf", 20) guiSetFont(GUIEditor.memo[1], font0_seguisym) end )
  16. مسوي كدا لكن ما يجي خط معين بالايديت بوكس او بالميمو
  17. سلام عليكم كيف اخلي الكلام الي يكون بالايديت بوكس او بالميمو بخط معين ؟ محاولتي بس ما ظبطت GUIEditor.memo[1] = guiCreateMemo(45, 58, 475, 346, "وشكرا", false, GUIEditor.window[1]) local font0_seguisym = guiCreateMemo(":guieditor/fonts/se.ttf", 20) guiSetFont(GUIEditor.memo[1], font0_seguisym)
  18. سلام عليكم عندي مود يرسل رسالة للكل علي شاشاتهم ابي لو احد كتب باف 8 ss الرسايل ما عادت تجييله ولو كتبها تاني الرسايل تجيله مرة تانية محاولتي: function tst () setElementData ( resourceRoot, "Shot_" , false ) aSend = false end addCommandHandler ("ss",tst) المشكلة هنا لما اكتب ss الرسالة الي مكتوبة علي الشاشة تختفي لكن الرسالة التانية تظهر عادي
  19. اعتقد المشكلة من مود الديربي نفسه
  20. سلام عليكم ابي لو حطيت اسم حساب شخص معين بالمود يكون command.mute يتفعل له يعني يقدر يصك ناس ميوت مع ان رتبته قليلة عادي hasObjectPermissionTo( player, 'command.mute', true )
  21. شكرا حليت المشكلة تسلموا @Sha67 @Denay.
  22. سلام عليكم ابي لما الديربي يبدا - الزر المعين دا يشتغل -- سويت ترايقر بمود الديربي واستقبلته بالكلنت حق اللوحة ولكن الزر ما يفتح لما الديربي يبدا وش المشكلة؟ كلنت : addEvent ( "openbutt", true ) addEventHandler ( "openbutt", root,function () guiSetVisible(GUIEditor.button[4],true) guiSetVisible(GUIEditor.button[5],true) guiSetVisible(GUIEditor.button[6],true) end ) سيرفر : function checkPlrs () c = 0 for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then c = c+1 end end if tonumber(c) > 1 then setElementData(resourceRoot,"map","yes") for i,p in pairs(getElementsByType("player"))do if checkExistPlrOnDuel(p) then setElementCollisionsEnabled(getPedOccupiedVehicle(p),true) outButDxChat("#c4c4c4亗 #ffc34a[#f75152 Derby System #ffc34a]#f75152 لقد بدآء الديربي , يمكنك الانطلاق",p,0,255,0,true) setElementFrozen(getPedOccupiedVehicle(p),false) triggerClientEvent("openbutt", localPlayer) end end
  23. السلام عليكم ابي اللوحة ما تفتح غير بعد 10 ثواني مثلا كيف ادري انه ب setTimer بس بيكون كيف الكود
  24. سلام عليكم ابي لما اضغط زر يسحب من شخص سيارته ويعطيله سيارة جديدة محاولتي Vehicle = { } addEvent ( "Take:Vehiclee", true) addEventHandler( "Take:Vehiclee",root, function ( ) x,y,z = getElementPosition ( source ) if ( getElementType(element) == "vehicle" ) then destroyElement(element) Vehicle[source] = createVehicle ( 502, x, y, z ) warpPedIntoVehicle ( source, Vehicle[source] ) outputChatBox( "* Done you give Car.",source,0,255,0,true) end end )
×
×
  • Create New...