
xXMADEXx
Members-
Posts
2,718 -
Joined
-
Last visited
Everything posted by xXMADEXx
-
Hello everyone, I'm making an app for MTA servers, but I can't seem to find anywhere to query the MTA server list. I tried checking the MTA source code, but couldn't find where it gets the server list from. If someone could send me a link or API that will give me the server list, that would be awesome! Thanks.
-
What did you put for the Lua script?
-
From my experience, C++ is probably the most powerful language there is, however its a little bit tricky to learn because it uses a very different syntax than most popular languages such as Java, PHP, etc. Java is also very powerful, and really easy to learn because it has a similar syntax to a lot of other languages. It's easy to read and write code in, so I strongly recommond learning Java. If you're looking into backend website development, you'll definitely want to learn PHP, it's not very hard to learn at all. It runs server-code (meaning the client won't affect how it's ran) so it allows you to control things like files on the server, http requests, and sql. The best forums to use would be: Stack Overflow: http://stackoverflow.com/ MSDN Developer Network: https://social.msdn.microsoft.com/Forums/en-US/home The New Boston: http://thenewboston.com/ You should also check out TheNewBoston on YouTube, he gives tutorials for pretty much every popular language, and his tutorials are easy to follow and he does an out-standing job on explaining whats going on. His C++ playlist: You should also learn other scripting-type languages such as Python and maybe Ruby/Ruby on Rails. They're powerful, while being easy to learn. Code Academy has some great courses on this.
-
You never canceled the event. addEventHandler("onPlayerChat", root, function() local account = getPlayerAccount( source ); if ( isGuestAccount(account) ) then outputChatBox("Login to your account to use chat", source); cancelEvent ( ); end end );
-
You can set a variable at the begning, and set it equal to getTickCount. When finished, the time taken will be: getTickCount ( ) - beginingVariable . Here's an example: local beginingTick = getTickCount ( ); local marker = createMarker ( 0, 0, 3, "cylinder", 5, 255, 255, 255, 255 ); addEventHandler ( "onMarkerHit", marker, function ( p ) outputChatBox ( "Time taken: ".. math.floor ( ( getTickCount ( ) - beginingTick ) / 100 ).. " seconds!", p ); end );
-
You can try to follow how I did it in my Nerd Gaming mp3 player script. https://github.com/braydondavis/Nerd-Ga ... client.lua Use xmlLoadFile to load the file, then xmlNodeGetChildren to get all the "song" children, then xmlNodeGetAttribute to get the name, length, and played. This is the function that I used in the NG mp3 player to load the xml radio stations: function getRadioStations ( ) local data = { } local file = xmlLoadFile ( "@xml/usermusic.xml" ) or createUserMusicFile ( true ) for i, v in ipairs ( xmlNodeGetChildren ( file ) ) do table.insert ( data, { tostring ( xmlNodeGetAttribute ( v, "name" ) ), tostring ( xmlNodeGetAttribute ( v, "url" ) ) } ) end xmlUnloadFile ( file ) return data end
-
Thanks [quote name=..&G:..]Really helpful if you want to add mods to your server with no waiting time! (Nearly) Thank you
-
Even i think Mysql is the only way in MTA.(I might be wrong). PHP does work, using the PHP_SDK.
-
I know using return works with PHP, but I don't quite remember how to use the MTA PHP SDK. What happens if you run this? Also, make sure that the website-login (in mta class constructor) is authorized. print_r ( $mtaServer->getResource("someResource")->call("someFunction") ); If this is just returning an empty array, can you post your lua code please?
-
Actually, to round up it's math.ceil or you could use Math.round.
-
The best way would to probably use element data, but not synch it with the server-side, unless you really need to. You should make the table only store so much key presses, because the table could get very large, very quickly. ex. only store the last 100 buttons pressed.
-
Try checking this link: https://wiki.multitheftauto.com/wiki/Se ... our_server
-
I don't have anybody to help me to test it but it should work. Im sure there's loads of people who would like to help, all you gotta do is ask.
-
In c_main.lua, find where it has dxDrawImage (Should be lines 329, 330 with an un-modified script) and just either comment them or remove them from the script.
-
There's tons of community scripts to get positions. Here's one: https://community.multitheftauto.com/index.php?p= ... ls&id=6274 If you're trying to disable weapons in a certain area, I'd recommend that you use createColCuboid and check if the player is in the colshape if they try to shoot.
-
Can you post the debug error? (/debugscript 3)
-
Do you mean doing something like this? local x,y = guiGetScreenSize() local admin = "" local mensagem = "" local iv = false local ATIVADO = false a1 = 200 a2 = 255 local lastColorChange = getTickCount ( ); local color = 1; addEvent("show", true) function mostrar(player, msg) lastColorChange = getTickCount ( ); lastColor = 1; mensagem = msg admin = player ATIVADO = true a1 = 200 a2 = 255 if (isTimer(timer1)) then killTimer(timer1) end timer1 = setTimer(function() setTimer(function() if a1 > 0 then a1 = a1 - 5 end if a2 > 0 then a2 = a2 - 5 end if a1 <= 0 and a2 <= 0 then ATIVADO = false admin = "" mensagem = "" end end, 50, 53) end, 6000, 1) end addEventHandler("show", getRootElement(), mostrar) function drawStuff() if (ATIVADO == true) then if ( getTickCount() - lastColorChange >= 3000 ) then lastColorChange = getTickCount ( ); if ( lastColor == 1 ) then lastColor = 2; else lastColor = 1; end end if ( lastColor == 1 ) then dxDrawRectangle ( x/50, y/2.8, x/3, y/5, tocolor ( 87, 27, 239, a1 ) ) dxDrawRectangle ( x/50, y/2.8, x/3, y/30, tocolor ( 0, 43, 65, a2) ) else dxDrawRectangle ( x/50, y/2.8, x/3, y/5, tocolor ( 255, 255, 255, a1 ) ) dxDrawRectangle ( x/50, y/2.8, x/3, y/30, tocolor ( 200, 200, 200, a2) ) end dxDrawText (string.gsub ( admin, "#%x%x%x%x%x%x", "" ), x/40, y/1.42, x/4.6, y/25, tocolor ( 0, 0, 0, 255 ), 1, "sans", "center", "center", false, false, false, false) dxDrawText (string.gsub ( admin, "#%x%x%x%x%x%x%x%x", "" ), x/40, y/1.42, x/4.6, y/25, tocolor ( 255, 255, 255, 255 ), 1, "sans", "center", "center", false, false, false, true) dxDrawText ( mensagem, x/32, y/2.52, x/4.6, y/2.4, tocolor ( 255, 0, 0, 255 ), 0.0, "clear", "left", "top", true, true, false, false) dxDrawText ( mensagem, x/35, y/2.53, x/4.0, y/1.1, tocolor ( 255, 255, 0, 255 ), 1.2, "clear", "left", "top", true, true, false, false) end end addEventHandler("onClientRender", root, drawStuff)
-
Thank you, everyone.
-
You should check this: https://github.com/Woovie/dxGUI
-
Does "Sending server-side" output? Are there any debug errors (/debugscript 3)
-
This might be funny... If you were like 10, more immature than anything really. banFromForum ( getUserFromName ( "ccv" ) )
-
RAM: 6GB Hard Drive: 2,128GB (2 1TB HDD's, 1 128GB HDD) Processor: (Dual Core) AMD A4-3420 APU with Radeon HD Graphics @ 2.8 GHz Video: NVIDIA GeForce GT 640 - 4GB
-
Do you mean to load the XML? If not, please explain a bit more. Here's an example: local file = xmlLoadFile ( "xml_file.xml" ); local children = xmlNodeGetChildren ( file ); for index, node in pairs ( children ) do if ( xmlNodeGetName ( node ) == "level" ) then local name = tonumber ( xmlNodeGetAttribute ( node, "name" ) ); local exp = tonumber ( xmlNodeGetAttribute ( node, "exp" ) ); local data1 = tonumber ( xmlNodeGetAttribute ( node, "data1" ) ); local data2 = tonumber ( xmlNodeGetAttribute ( node, "data2" ) ); outputChatBox ( "Name: ".. name ); outputChatBox ( "Exp: ".. exp ); outputChatBox ( "Data1: ".. data1 ); outputChatBox ( "Data2: ".. data2 ); end end
-
At the moment it only supports replacing vehicle models, nothing to do with handlings. I haven't decided if I'll add some type of cusotm handling data yet, but probably wont because it's not hard to script custom handling with setModelHandling. If such thing is so easy to implement why would you simply discard such a small yet important feature, considering your resource is 100% focused on replacing vehicles, which benefit and sometimes require custom handling to work as the author originally intended? Not complaining, just really intrigued. Well it's a bit of a different story, when trying to implement it to the mod downloader. It would be much more difficult to build a way to add custom handling files into the mod downloader, because of the way that I scripted it. It would just be easier to use the setModelHandling function. Thank you! I'll probably end up creating a force-enable here pretty soon. I like the progress bar idea, however I don't think I'm going to do it, simply for the reason that I would be unable to get live/percentages. Meaning, the progress bar would only increase after a file finished downloading, because MTA doesn't have a way to get the percentage that a file download is currently at. Thank you for the feedback.