![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Dealman
Members-
Posts
1,421 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Dealman
-
How about outlining DX rectangles using DX lines instead? Currently you can not make a transparent outlined rectangle since there will be black ones behind it. Great to see that it's still being updated!
-
Allow me to quote a post which was posted a while ago;
-
Is that the entire function? What if you move this part to the very top of the function? if (button == "left" and state == "up") then
-
It's rather simple; 1. When your resource is started, it creates the GUI. By default, the window is visible after creation. 2. When you press F2, it will toggle the cursor, and set the visible state of the window to the opposite. Since it's already visible(true), you'll be setting it to not visible(false). The fix is simple; mainWindow = guiCreateWindow(463, 151, 367, 501, "Player Statistics", false) guiSetVisible(mainWindow, false) By doing this, the state will be false - thus when you first press F2, it will change to true - making the window visible.
-
Alternatively you can also use the same code as I did for an old login panel of mine. It should make it automatic. You'll have to figure out how to use it yourself, though. It shouldn't be too hard if you're familiar with tables in Lua. -- Define Data Constructs local stage1 = {}; function addLoginPanelLabel(dataConstruct, theRef, theText, PosX, PosY, SizeX, SizeY) if(dataConstruct[theRef] == nil) then dataConstruct[theRef] = {["Text"] = theText, ["textLabel"] = {["PosX"] = PosX, ["PosY"] = PosY, ["SizeX"] = SizeX, ["SizeY"] = SizeY}}; if(dataConstruct[ref] == nil) then return false; else return true; end end end function deleteLoginPanelButton(dataConstruct, ref) if (dataConstruct[ref] == nil) then return false else dataConstruct[ref] = nil if (dataConstruct[ref] == nil) then return true else return false end end end function addLoginPanelLabel(dataConstruct, theRef, theText, PosX, PosY, SizeX, SizeY) if(dataConstruct[theRef] == nil) then dataConstruct[theRef] = {["Text"] = theText, ["textLabel"] = {["PosX"] = PosX, ["PosY"] = PosY, ["SizeX"] = SizeX, ["SizeY"] = SizeY}}; if(dataConstruct[ref] == nil) then return false; else return true; end end end function deleteLoginPanelLabel(dataConstruct, theRef) if (dataConstruct[theRef] == nil) then return false else dataConstruct[theRef] = nil if (dataConstruct[theRef] == nil) then return true else return false end end end function showOnStart_Handler() if(stage1Active == false and stage2AActive == false and stage2BActive == false) then showCursor(true); addEventHandler("onClientPreRender", getRootElement(), drawStage1Text_Handler); addLoginPanelButton(stage1, "loginButton", "Images/ButtonUnlit.png", 0.3625, 0.6875, 0.0566, 0.0911, "< Login", 0.4227, 0.7148, 0.5139, 0.7552); addLoginPanelButton(stage1, "registerButton", "Images/ButtonUnlit.png", 0.3625, 0.8242, 0.0566, 0.0911, "< Register", 0.4228, 0.8529, 0.5537, 0.8919); stage1Active = true; end end addEventHandler("onClientResourceStart", resourceRoot, showOnStart_Handler); function drawStage1Text_Handler() dxDrawImage(0, 0, screenX, screenY, "Images/FAG_Background.jpg"); local mSX, mSY = getCursorPosition(); local mSX, mSY = mSX*screenX,mSY*screenY; for referenceName, theArray in pairs(stage1) do dxDrawImage(theArray["buttonImage"]["PosX"], theArray["buttonImage"]["PosY"], theArray["buttonImage"]["SizeX"], theArray["buttonImage"]["SizeY"], theArray["buttonImage"]["imageSource"], 0, 0, 0, tocolor(255, 255, 255, 255), true); dxDrawText(theArray["Text"], theArray["buttonText"]["PosX"]+1, theArray["buttonText"]["PosY"]+1, theArray["buttonText"]["SizeX"]+1, theArray["buttonText"]["SizeY"]+1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "Left", "top", false, false, true, false, false); dxDrawText(theArray["Text"], theArray["buttonText"]["PosX"]+1, theArray["buttonText"]["PosY"]-1, theArray["buttonText"]["SizeX"]+1, theArray["buttonText"]["SizeY"]-1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "Left", "top", false, false, true, false, false); dxDrawText(theArray["Text"], theArray["buttonText"]["PosX"]-1, theArray["buttonText"]["PosY"]+1, theArray["buttonText"]["SizeX"]-1, theArray["buttonText"]["SizeY"]+1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "Left", "top", false, false, true, false, false); dxDrawText(theArray["Text"], theArray["buttonText"]["PosX"]-1, theArray["buttonText"]["PosY"]-1, theArray["buttonText"]["SizeX"]-1, theArray["buttonText"]["SizeY"]-1, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "Left", "top", false, false, true, false, false); dxDrawText(theArray["Text"], theArray["buttonText"]["PosX"], theArray["buttonText"]["PosY"], theArray["buttonText"]["SizeX"], theArray["buttonText"]["SizeY"], tocolor(187, 0, 0, 255), 1.00, "bankgothic", "Left", "top", false, false, true, false, false); if(mSX >= theArray["buttonImage"]["PosX"] and mSX <= theArray["buttonImage"]["PosX"]+theArray["buttonImage"]["SizeX"]) and (mSY >= theArray["buttonImage"]["PosY"] and mSY <= theArray["buttonImage"]["PosY"]+theArray["buttonImage"]["SizeY"]) then -- Button Active theArray["buttonImage"]["imageSource"] = "Images/RedButtonLit.png"; else -- Button Inactive theArray["buttonImage"]["imageSource"] = "Images/ButtonUnlit.png"; end end end
-
The colours are a bit obnoxious to say the least, maybe go with something that's a bit easier on your eyes? Also maybe try to center things a bit more, make it look a bit more professional rather than sloppily thrown together. For example, even spacing between things, to keep some uniformity in it all. Also, to make things look better, you should outline things. You can check my tutorial for some "utility functions". Maybe you'll find them useful
-
So just because something was given to you, you assume you have the right to sell something someone else made? That is not how things work. If someone let you use their car, would you sell that as well?
-
You could find it so easily by just searching on google. MTA Lua Compiler
-
How is he wasting his time? He's being nice helping the community by creating free scripts, it's very nice for those who aren't as willing and/or capable of learning to code. Also, scripts for MTA is not a software, it's very different. If anything, it's but a small plugin for MTA. What people fail to realize around these forums is that what MTA offers is but a very, very noob-friendly API. It's so friendly and well documented it's basically impossible not to learn it. And then those who think their "Lua level" is 90% try to do something outside of MTA, say "raw" Lua coding - they quickly realize that it's not like anything what they wrote for MTA. It's a lot harder and much more time consuming actually writing a software, than a plugin for a software using their API. Now I'm not trying to say whether selling your scripts is right or wrong, in the end that is up to the MTA Team or even Rockstar(If MTA Team is found to make profit out of MTA without permission from Rockstar, Rockstar can and probably will issue a cease and desist), depending how in-depth you want to go. But by all means, if you want to try to sell it go ahead. If people are interested, they'll buy it. Personally I would just find this script to be an annoyance, rather than anything interesting. But that's my opinion
-
So did you update it or did you just make a new thread only to link to your original one...?
-
I usually replace some telephone wires, but that's for like Race and DD maps. What about the food objects? I don't think there are any "unused" objects...
-
For safety reasons, I would highly suggest against confirming whether a player is an admin or not using Element Data. Instead, you can use triggerClientEvent to utilize the function you provided.
-
You use hashtag to count table contents, for example; #skins[1] should return 6.
-
That is incorrect, I don't know if there's any direct limit for how many you can use, but I know that you can use more than 1 and 2
-
This can all be found either by searching or looking at the MTA Wiki. For example getCurrentFPS.
-
After having restarted both the client and server multiple times, it seems to have fixed itself. I were streaming when this happened, so if you want to take a look at it - you can do so here. It all started with the Bandito behaving weird, sort of like not getting grip. After this it just gradually became worse and worse. Basically around 32:44 is where you'll want to take a look at, I guess... I sincerely doubt it has anything to do with my models and/or textures, as they have been working completely fine before and I had made no changes to them. Possibly something to do with engineReplaceModel, perhaps?
-
The player remains visible, I can still drive around just fine. My laptop was seeing the same thing happening
-
Been working on a new gamemode lately and it's been going very well so far, until today, when MTA completely decided to take a dump. Whenever I enter a vehicle on my server, they become invisible. This happens on both my desktop and my laptop, with no other resources than the default ones running(Admin, Play & Freeroam etc). This does not happen if I'm messing about in the map editor, however. Only if I actually host a server. Anyone got some ideas what on earth is going on? It was perfectly fine just a few days ago.
-
I strongly advice against storing Admin permission related stuff in Element Data...
-
You'll have to set their wheels whenever they hit vehiclechanger pick up. Take a look at this.
-
It's a really simple thing to do. I'd love to help you out for free, but I don't use Skype, nor do I intend to download it Just send what you need fixed in a PM and I'll sort it out for you.
-
misc_a = Turret (Mesh) misb_b = Gun Mantlet (Mesh) misc_c = Muzzle (Dummy)
-
Check if the value is nil. If it is, use table.remove. table.remove(theTable, theIndex);
-
You'd have to create a for loop to loop through all of the indexes in the table.