Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 26/09/16 in all areas

  1. This resource (Player Geolocation) was created by Tails from G&T Mapping. Check us out on Facebook: https://fb.com/gtmapping About: Player Geolocation is a replacement tool for the MTA:SA default (/whois) function. This tool gives you much more information about a player with an interactive Google Maps feature (see pictures). Installation: Give the resource access to fetchRemote and your server needs to have HTTPS support (MTA:SA 1.5.2). How do I do that? Open the admin panel > resources tab > Manage ACL (upper right corner) under Groups select Admin then Add Object and name it: resource.geolocation That's it. How to use it: /lookup [name or domain name] in e.x. /lookup Jimmy or /lookup google.com Press escape to close the panel Press X to toggle the panel Download: Player Geolocation Tool 1.0
    2 points
  2. Yeah I talked to darkdreamingdan about it. Seems like the plugin had an issue before. I tested it here to show him
    2 points
  3. TUTORIAL/GUIDE NO LONGER MAINTAINED This tutorial is no longer maintained and it's contents may be deprecated or no longer work. I created this tutorial in 2014, when I was very involved with MTA and the community around it. Due to the nature of life, I ended up leaving MTA to focus on more important things (work, family, life, etc). I believe this tutorial has helped a lot of people get into scripting for MTA over the years, and I'm happy I was able to do answer questions and help people get into coding! Introduction Hello everyone, and thank you for viewing my introduction for Lua scripting. This tutorial will cover the basics of Lua, but nothing too advanced. This tutorial is highly detailed and should give you a pretty good understanding on how Lua works, even if you have never coded it before. Something to remember is that I do not teach or even talk about using object-oriented programming in this tutorial. Things you'll be learning: For general lua - Variables - Complete - Tables - Complete - Functions - Complete - Return - Complete - Loops - Complete - If/Else/Elseif - Complete - Usage of pre-defined variables Any type of programming - Formatting your code For mta - Create a resource and what is required for one - Complete - Events - Complete - Commands - Complete - Exports & how to call one - Complete So, now that you know what you're going to be learning about, let's get started! Variables Tables Functions Working with return inside functions Loops If/Else/Elseif Usage of pre-defined variables __________________________________________________________________________________________________ Formatting your code __________________________________________________________________________________________________ Making a resource Introduction to events Commands Exports Good luck with your Lua scripting career, I hope that this tutorial has helped you!
    1 point
  4. I've since investigated implementing MediaWiki's visual editor in depth. It basically isn't an easy thing to add, and has a lot of moving parts. You have to install several plugins for it to work correctly, and there were still a few bugs on our Wiki. We might revisit it once it becomes stable and is integrated into MediaWiki's default package.
    1 point
  5. كيف يعني تطرح اكوادك انسخ كودك والصقه ب لغة lua فقط ما تترجم هي الكلمة اطرح يعني اطرح
    1 point
  6. Ошибка где-то в скрипте.
    1 point
  7. تعلم لغه الجافا منه تستطيع انشاء تطبيقات على الويندوز او على أجهزه الأندرويد ويمكنك ايضا تصميم المواقع لكن ليس بأحترافيه البي اتش بي والروبي
    1 point
  8. Nice ! That's really good . Keep Up
    1 point
  9. كود نصور الصحيح كذا اي بيد بيصير له كنسل ايفنت بالرووت
    1 point
  10. For now you can't change your topic title, administration is already know's that if you want to change the title report about it and tell what you want the new title of your topic or you can send a 'PM' to one of the forum moderators . @jhxp
    1 point
  11. OMG, This is the greatest thing I saw in MTA Keep up the good work.
    1 point
  12. Use fetchRemote to save it as text, you then pass this onto the client to read through it using the XML functions(unless you need to do it on the server). To see how things are structured, right-click your own page and save as. I was working on a resource before which would fetch internet radios from internet-radio.com and parse through them for easy streaming. Here's a snippet of the code to see how I parsed through it; for nodeIndex, theNode in ipairs(stationNodes) do if(xmlNodeGetName(theNode) == "tr") then if(nodeIndex <= #stationNodes-1) then local stationInfo = xmlNodeGetChildren(theNode); for nodeIndex, theNode in ipairs(stationInfo) do if(xmlNodeGetName(theNode) == "td") then if(nodeIndex == 1) then -- Parse URL local urlNode = xmlFindChild(theNode, "a", 0); local onclickAttribute = xmlNodeGetAttribute(urlNode, "onclick") local findURL = string.match(onclickAttribute, "http?://[%w-_%.%?%.:/%+=&]+"); --outputChatBox("Debug URL: ["..tostring(findURL).."]"); table.insert(g_RadioStations_URL, #g_RadioStations_URL, findURL); elseif(nodeIndex == 2) then -- Parse Name local nameNode = (xmlFindChild(theNode, "span", 0) or xmlFindChild(theNode, "a", 0)); if(theName ~= false) then local theName = xmlNodeGetValue(nameNode); local theNameFix = string.gsub(theName, "[\n+]", ""); local theNameFix = string.gsub(theName, "&amp;", ""); --outputChatBox("Debug Name: ["..tostring(theNameFix).."]"); table.insert(g_RadioStations_Name, #g_RadioStations_Name, theNameFix); end elseif(nodeIndex == 3) then -- Parse Bitrate local bitRateRaw = xmlNodeGetValue(theNode); local bitRateFix = string.gsub(bitRateRaw, "[\n+]", ""); --outputChatBox("Debug Bitrate: ["..tostring(bitRateFix).."]"); table.insert(g_RadioStations_Bitrate, #g_RadioStations_Bitrate, bitRateFix); end end end end end end
    1 point
  13. Sweet I can now properly hunt down players who are annoying, thanks!
    1 point
  14. Just use https://wiki.multitheftauto.com/wiki/OnPlayerChat, check if type is 1, cancel the event, output it in your own way.
    1 point
  15. function vidacolete() local marcos = getTeamName(getPlayerTeam( source )) local armor = getPedArmor( source As far as I can tell, source is never defined. Try replacing source with client.
    1 point
  16. UPDATES: - Changed input mode for the gui - Fixed a major bug with the challenge timer ended very fast (Now the timer ends after 45 seconds) - Updated the clan war drawing when there was a war being held Screenshot:
    1 point
  17. Sim o projeto continua ativo, e todas atualizações estão no tópico em que o MaligNos citou, principalmente em nossa Fãpage San Andreas Fusini Brasil. Prezamos pela qualidade nelson, em prol disso, o tempo não é um inimigo para nós, não queremos compartilhar uma experiência monotonia. A novidade é que, mudamos nossa empatia, sendo assim, a partir do mês que vem, todos poderão jogar mesmo com o server em versão beta. As atualizações e modificações constantes é o nosso forte, temos complacência quanto a isso. Só aguardar, informações muito em breve.
    1 point
  18. Editing first posts in topics is now enabled, but only in the following forums: scripting->tutorials 123 maps->showroom 73 resources 87 other creations->custom gui themes 115 other creations->other 116 servers->servers to play on 92 servers->hosting solutions 93 arabic 96 arabic->scripting->tutorials 137 arabic->contributions 135 arabic->hosting 138 pt->tutorials 126 pt->maps 130 ru->tutorials 128 ru->servers 133 es->resources 121 / 168 es->hosting solutions 147 / 170 es->servers to play on 148 / 171 Edit by jhxp: Editing first posts is now also enabled in the following forums: servers 91 competitive gameplay->leagues and events 23 competitive gameplay->gangs 8 ro->servere 162 Editing first posts in all PINNED topics is also activated. Moreover, you can now edit any of your previous posts for a duration of up to 25 minutes. Please post here if you think another forum section should be activated for this feature, or if you have any issues using this feature.
    1 point
  19. Thanks for the suggestion. Our approach of late is for less customisation to our platforms, rather than more. The current (largely broken) state of the wiki - particularly regarding the logins - is due to the amount of complexity that custom plugins introduce. A motivation for switching to IPB is that it had 90% of PHPBB's features without any customisations. Right now we're focusing on just trying to get the wiki working again with logins etc. Once that happens we can reevaluate customisations, but it is unlikely to happen in the near future.
    1 point
  20. Try this local blips = {} -- blips table function Blip () local players = getElementsByType("player") for id, player in ipairs(players) do local team = getPlayerTeam(player) if team then local r, g, b = getTeamColor(team) if blips[player] then setBlipColor (blips[player],r, g, b,255) else blips[player] = createBlipAttachedTo(player, 0, 2, r, g, b) end end end end setTimer(Blip, 5000, 0) -- destroy the blip (onPlayerQuit,onPlayerLogout,onPlayerWasted) function quit () if blips[source] then -- if the blip exist then destroyElement(blips[source]) -- destroy it blips[source] = nil end end addEventHandler("onPlayerLogout", getRootElement(), quit) addEventHandler("onPlayerQuit", getRootElement(), quit) addEventHandler("onPlayerWasted", getRootElement(), quit)
    1 point
  21. Hello, I've a function (sqlCheck) that executes a dbQuery using a callback function (myCallBackFunc). In the callback function (myCallBackFunc), I process the result etc... But I want to return a value from this callback function (myCallBackFunc) to the function that first called it (sqlCheck). Is it possible? Most likely it's not, just making sure.
    1 point
  22. You're right. Yes, if you have 2 coroutine.yield, it will stop twice and will continue from that very respective yield. The idea is actually very simple, a call to coroutine.yield will pause and wait for a return, which only happens through coroutine.resume, much like using executeSQLQuery or dbPoll with -1, it pauses everything and wait for the result and then continues with the rest of the code.
    1 point
  23. This might explain what CrystalMV meant: local db_coroutine = coroutine.create(function() dbQuery(callback, database, "SELECT * FROM table"); local queryHandle = coroutine.yield(); local result = dbPoll(queryHandle, 0); -- more code end); coroutine.resume(db_coroutine); function callback(queryHandle) coroutine.resume(db_coroutine, queryHandle); end This is what happens: you first create your coroutine by passing it its main function, we then start the coroutine by running coroutine.resume, our function gets executed, the first line (dbQuery) gets called and then the coroutine yields (waits until another call to coroutine.resume is ran). In our callback, we run coroutine.resume once more passing it our queryHandle, which will be sent to coroutine.yield and the rest of the function will get called. It's more than okay if you don't understand any of that, coroutine and multithreading are not exactly simple. Remember that all you really need is to just use callbacks. More links for coroutines tutorials: http://www.lua.org/pil/9.html http://lua-users.org/wiki/CoroutinesTutorial
    1 point
  24. Calling dbPoll with -1 timeout parameter will wait for response. That's how it will return the result to the calling function. If you instead want to suspend the execution of function and resume it when result is available (without forcing the whole server to wait), use coroutines (http://www.lua.org/manual/5.1/manual.html#2.11).
    1 point
×
×
  • Create New...