Jump to content

HassoN

Members
  • Posts

    636
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by HassoN

  1. HassoN

    سؤال

    destroyElement(MarkerName) راح تمسح لك اخر ماركر اتصنع فقط
  2. بالنسبة لمشكلتك الاولى local myTable = {"TEST", "1", "2", "3"} function test() for i, v in ipairs(myTable) do dxDrawText(v, 158, 135, 20, 10, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) end end addEventHandler("onClientRender", root, test) الي ف اللوب i بس كذا الكلام بيجي فوق بعضه طبعاً ، لو تبي الكلام ينزل تحت بعضه او جنب بعضه العب الاحداثيات باستغلال الـ
  3. HassoN

    playSound3D

    By using playSound3D you have to use a direct link to the audio source, for example a link that ends with ".mp3" Accepted formats: MP3, WAV, OGG, RIFF, MOD, XM, IT and S3M. And about youtube, You can not do it directly but I believe there's a work around, some APIs could convert youtube links into MP3 links then you may play them.
  4. Info في جهة كلنت حاط شي اسمه لكن ف جهة سيرفر مو راسله مع التريقر شوف ذا triggerClientEvent(player,"podiumStart",player) المفروض تضيف الي بترسله هنا
  5. Hey, use: -- a timer or onClientRender should be used to check the distance between players then you should use: setControlState -- forward, sprint, walk setElementRotation
  6. HassoN

    XML file

    Same as the example above xmlFindChild -- use index 1 this time as you want to modify your 2nd line. xmlNodeSetAttribute -- modify the text you want
  7. وعليكم السلام العملية ذي شغلتها قريبة من اللوب ، بتقعد تسوي وظيفة لين مايصير العكس ، مدري كيف بشرحها بس يارب تفهم المثال local number = 0 -- نفترض رقم معين while (number ~= 5) do -- الحين بنقول دام الفاربل حقنا لايساوي 5 فـ بيفضل شغال number = number + 1 -- بنزيد ع الفاربل 1 كل شوية print(number) -- بس عشان نشوف النتيجة end الي بيطلع من الكود الي فوق ، انه بيقعد يضيف 1 ع المجموع لين مايوصل ل5 ثم يوقف ان شاء الله فهمت
  8. HassoN

    XML file

    Because you update your XML on server side, then you load it from client, therefore it is not updated. You should load it from server, check this out: -- client function refreshrr() triggerServerEvent("refreshList", resourceRoot) end function sendInfo(myTable) guiGridListClear(gridSms) for i, v in ipairs(myTable) do local row = guiGridListAddRow(gridSms) guiGridListSetItemText(gridSms, row, columnInt1, v[1], false, true ) guiGridListSetItemText(gridSms, row, columnInt2, v[2], false, false ) end end addEvent("sendInfo", true) addEventHandler("sendInfo", root, sendInfo) -- server function refreshList() local node = xmlLoadFile("reports.xml") if (not node) then return false end myTable = {} local reports = 0 while ( xmlFindChild(node, "report", reports) ~= false ) do local report = xmlFindChild ( node, "report", reports ) table.insert(myTable, {xmlNodeGetAttribute(report, "vremya"), xmlNodeGetAttribute(report, "Name")}) reports = reports + 1 end xmlUnloadFile(node) if (#myTable > 0) then triggerClientEvent(client, "sendInfo", client, myTable) end end addEvent("refreshList", true) addEventHandler("refreshList", root, refreshList)
  9. HassoN

    XML file

    Use: local xml = xmlLoadFile("file.xml") -- loads the file local child = xmlFindChild(xml, "report", 1) -- 1 here represents the index local myData = xmlNodeGetAttribute(child, "vreamya") -- gets the value of "vreamya" xmlUnloadFile(xml) -- unloads the file
  10. I believe it is from MTA itself, correct me if I am wrong.
  11. HassoN

    Chat Radius

    Hey, You could use a loop of all players, get their positions and compare it to the player who uses the chat, if it is 10 meters away or less from the player then show the message. Something like: for i, v in ipairs(getElementsByType("player")) do local x, y, z = getElementPosition(v) local x2, y2, z2 = getElementPosition(player) -- player represents the player who triggered the chat command. local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if (distance <= 10) then outputChatBox("YOUR MESSAGE", v) end end
  12. HassoN

    XML file

    As I can see it is a report system, and you are trying to load the file from client side. That's totally unsafe, people can modify the content of that file. Use only server side and you may stay update your gridlist by using a trigger.
  13. HassoN

    XML file

    Which code are you talking about? Try to be more precise in your issue. xmlFindChild -- line 2 xmlDestroyNode -- destroy it.
  14. ؟؟ aSuport ما اشوف الايفنت الي اسمه
  15. HassoN

    XML file

    1) local xml = xmlLoadFile("file.xml") -- your file name local children = xmlNodeGetChildren(xml) if children then for i, v in ipairs(children) do local name = xmlNodeGetName(v) if (name == "Admin" or name == "Otvet") then xmlDestroyNode(v) xmlSaveFile(xml) xmlUnloadFile(xml) return true end end end 2) local xml = xmlLoadFile("file.xml") local child = xmlCreateChild(xml, "report") xmlNodeSetAttribute(child, "vreamya", "1") xmlNodeSetAttribute(child, "Name", "2") xmlNodeSetAttribute(child, "Jaloba", "3") xmlSaveFile(xml) xmlUnloadFile(xml)
  16. HassoN

    gridlist

    You mean that player's name get duplicated after you trigger it more than once? Or you mean only if you do it once, then re-open the panel you get the text duplicated? If it was the 1st issue then you may check the table if it had that X variable inside then do nothing, otherwise add new line, something like: local savedText = {} function sendText(name) local duplicated = false for i, v in ipairs(savedText) do if (v == name) then duplicated = true end end if (not duplicated) then table.insert(savedText, name) end triggerClientEvent(root, "showText", root, savedText) end addEvent("sendText", true) addEventHandler("sendText", root, sendText)
  17. HassoN

    Help me

    You could use variables for such matter. Add a command that sets a variable to true and check for it when you render your DX function. for example: status = true -- when you enter X command if (status) then -- when you render your DX function -- your DX code end
  18. HassoN

    gridlist

    Use guiGridListClear
  19. ما ادري ليش تسوي موضوع جديد وانا معطيك الجواب ف موضوعك الي ماله اسبوع حتى
  20. HassoN

    gridlist

    myTable represents the 1st passed argument by the trigger "showText". It is fine. The code seems fine to me so I don't know what could cause the problem. P.S: I tried the code and it worked.
  21. HassoN

    gridlist

    I told you to copy the last version I posted. Your code doesn't match my last version. Here you go again: --client function sendreport () local name = getPlayerName(localPlayer) triggerServerEvent("sendText", resourceRoot, name) end addEvent("sendreport", true) addEventHandler("sendreport",root, sendreport) function showText (myTable) for i, v in ipairs(myTable) do guiGridListAddRow(gridSms, v) end end addEvent("showText", true) addEventHandler("showText",root, showText) --server local savedText = {} function sendText(name) table.insert(savedText, name) triggerClientEvent(root, "showText", root, savedText) end addEvent("sendText", true) addEventHandler("sendText", root, sendText)
  22. HassoN

    gridlist

    Make sure that the function's name at the 3rd argument of addEventHandler matches the function's name above. this part of the code is fine. Try to copy the last code I sent, because I've modified it.
  23. HassoN

    gridlist

    It says that instead of table, there's a nil value. Which line is that?
  24. HassoN

    gridlist

    --client function sendreport () local name = getPlayerName(localPlayer) triggerServerEvent("sendText", resourceRoot, name) end addEvent("sendreport", true) addEventHandler("sendreport",root, sendreport) function showText (myTable) for i, v in ipairs(myTable) do guiGridListAddRow(gridSms, v) end end addEvent("showText", true) addEventHandler("showText",root, showText) --server local savedText = {} function sendText(name) table.insert(savedText, name) triggerClientEvent(root, "showText", root, savedText) end addEvent("sendText", true) addEventHandler("sendText", root, sendText)
×
×
  • Create New...