-
Posts
168 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Backsage
-
I am trying to figure out how to get the positions, centering, and scaling for a window to work so that it works on all resolutions. Now right now, I'm just focusing this on guiCreateWindow. I'm working with the absolute arguments. I could use relative arguments, but then I'd have to make all of my other GUI elements use the relative arguments and I'd also have to scale them a little bit bigger so that they show up correctly on different resolutions. I was reading this topic: https://forum.multitheftauto.com/topic/27701-centering-a-window/ and I wanted to see if I could produce similar results. My old topic: https://forum.multitheftauto.com/topic/87889-help-make-guicreatewindow-scale-to-all-resolutions/ I did do what Bonus said and it does position and center like I'd want it to in a 1024 x 768 resolution. But if I do it on a 640 x 480 resolution, the window gets centered, but its x and y positions are not like in the 1024 x 768 resolution. These are the calculations: https://puu.sh/rJtqs/5c49d05d4f.png This is what it looks like ingame: in 1024 x 768 resolution: https://puu.sh/rJvZN/0a2eee5a14.png in 640 x 480 resolution: https://puu.sh/rJwPT/d8346932b8.png If however, I use relative arguments this happens: 1024 x 768 resolution: https://puu.sh/rJx0Z/c235408a4e.png 800 x 600 resolution: https://puu.sh/rJx1m/a4f68ce40f.png 640 x 480 resolution: https://puu.sh/rJx1S/0d6638a57e.png Notice how everything is positioned and scaled based on the resolution. Now I wanna know how to do it like relative, but using the absolute arguments. I just wanna know the math behind it. Now another question is, if I need some math to calculate it based on resolution, do I need to do something similar with the other gui elements? And I apologize for using puu.sh. I was kinda lazy.
-
Yeah, I don't know what you mean by hacking. What did he do? And what do you expect MTA Team to do about it?
-
Ok, so I tried double-clicking on Multi Theft Auto.exe, and then the logo pops up. I check my Task Manager and the Multi Theft Auto.exe and gta_sa.exe show up. Moments later, the logo disappears and then the processes disappear and nothing happens. I tried starting up gta_sa.exe, but the process appears and then quickly disappears.
-
This is why head admins of a server should set up like a donation system, but it make it so if they're developers, then they each get a piece of that donation and the rest of it pays for the server, unless that's not practical.
-
So if you want to create an element im the middle of the screen this might help you local screenW, screenH = guiGetScreenSize() local elemW, elemH = 300,400 --Your element width and height function testWindow() local theWindow = guiCreateWindow( (screenW - elemW)/2,(screenH-elemH)/2,elemW,elemH,"Test") end addEventHandler("onClientResourceStart, getRootElement(),testWindow) The formula to make a GUI elem in the middle of the screen is guiCreate(yourElement)( (screenWidth - elementWidth)/2,(screenHeight - elementHeight)/2,screenWidth,screenHeight,...) All this does is center it to the screen. I'm talking about making it actually scale based on the resolution. How is it that this only works when using relative values, but not for absolute values? If I use the relative argument, I have to do that on every single GUI element that's on the window, including the window, so that it'll scale properly. I can't just do it for the window or else the other GUI elements will be too big. I hope you understand what I mean.
-
Hi, I have a huge problem. Sometimes when I load lua code and it loads correctly, if I click on Output, nothing happens. Other times, this won't happen. I'm wondering if it's some sort of bug with gui editor.
-
Where did you get 1920 and 1080? I know it's a resolution, but why you chose those numbers? I tried pasting the code into gui editor, but nothing appeared.
-
Well, I am trying to create a window and I want it to scale properly on all resolutions. I tried using TEDERI's method, but it won't scale properly. I tried previewing it in different resolutions, but it doesn't scale. https://forum.multitheftauto.com/viewto ... 91&t=33149 http://pastebin.com/3N8Jb3iq
-
Ok, so I have a scrollpane and it automatically has a scrollbar. When I click on Classic TDM or Barrier TDM, the scrollbar thingy is at the top. But when I click on Cage, Platform, FFA, CTF, or TW, the scrollbar thingy is in the middle. I can move it to the top and close out and click the button again and it'll be at the topic. Why is it in the middle the first time? http://puu.sh/q1W76/01534a0541.jpg http://puu.sh/q1W8y/46676541a1.jpg Edit: The function guiScrollPaneSetVerticalScrollPosition solved my problem.
-
So, what is JTPenn doing now? Is he retired from MTA too?
-
Hi all. I'm trying out the spawnmanager resource. And I'm trying to create a spawnpoint, but it's not working. However, when I tried mark2 command, it spawned me somewhere and made a sound. Edit: I found out that the optional requirements for createSpawnpoint are actually required. That's why it wasn't working. Old: Fixed server: local spawnpointsTable = { } function createSpawnpointCmd(player,cmd,arg1) local x, y, z = getElementPosition(player) local rot = getPlayerRotation(player) local int = getElementInterior(player) local dim = getElementDimension(player) local skin = arg1 or 0 local spawnpoint = exports.spawnmanager:createSpawnpoint(x, y, z, rot, skin, int, dim) if spawnpoint then table.insert(spawnpointsTable, spawnpoint) outputChatBox("Created Spawn Point", player) else outputChatBox("Failed to create Spawn Point", player) end end addCommandHandler("createspawn",createSpawnpointCmd) function spawnPlayersCmd(player,command) local randomSpawn = math.random(1, #spawnpointsTable) for _,p in pairs(getElementsByType("player")) do exports.spawnmanager:spawnPlayerAtSpawnpoint(p, spawnpointsTable[randomSpawn]) end end addCommandHandler("spawnplayers", spawnPlayersCmd) function OnSpawnpointUse(player) playSoundFrontEnd(player, 16) end addEventHandler("onSpawnpointUse", root, OnSpawnpointUse)
-
Well I read up on the MTA Wiki about Access Control List and it talked about general and I was just curious about that. For example, general.modifyOtherObjects. What exactly is that "general" thing and where can I find modifyOtherObjects? And what is modifyOtherObjects?
-
Well I read up on the MTA Wiki about Access Control List and it talked about general and I was just curious about that. For example, general.modifyOtherObjects. What exactly is that "general" thing and where can I find modifyOtherObjects? And what is modifyOtherObjects?
-
In your case, I would ignore WAN, focus on LAN, type the port in LAN Host Start Port and in LAN Host End Port. So for example, if it was 22003, type 22003 in LAN Host Start Port and 22003 in LAN Host End Port. Type the name of the service. Make sure it's the right protocol. For LAN Host IP Address, I'm not sure about that. I don't know if it's required or not. If it is, I'd probably just put the Private IPv4 Address of your computer.
-
In your case, I would ignore WAN, focus on LAN, type the port in LAN Host Start Port and in LAN Host End Port. So for example, if it was 22003, type 22003 in LAN Host Start Port and 22003 in LAN Host End Port. Type the name of the service. Make sure it's the right protocol. For LAN Host IP Address, I'm not sure about that. I don't know if it's required or not. If it is, I'd probably just put the Private IPv4 Address of your computer.
-
Ok, so when I join a server, some of the resources load in the C:\Program Files (x86)\MTA San Andreas 1.3\mods\deathmatch\resources, but not all of them load. Why is that? Edit: Didn't know only client files are downloaded and not server files. Thanks.
-
If you're on Windows, go to cmd.exe, type ipconfig. Look for the Default Gateway. Type that in the URL bar of your web browser. Now go to your Firewall Settings. It might have something like Ports Forwarding or Applications. Click "Add new service". Type in the name of the service, and where it says Port Range, type of number of the port you want to open. It'll ask you whether it's UDP or TCP. Then click "Add to list". Do this for all the TCP/UDP ports. They are usually 22003 UDP, 22003 TCP, and 22126 UDP. Then go to the gridlist and where it says Add, add the application you just created. It might ask you where you want the application to be hosted on. It should be the name of the computer or some username. Or it might have automatically have it hosted on the computer you're on now. Then click add. Now if you have a Firewall or Antivirus program, go to the Firewall settings, go to some place where it says ports. Click on that and go to Add Service. Type the name of the application, add a category, add a description, and then type the UDP and TCP ports. Then add the service. Now go to your MTA Server.exe, type openports. The ports should now be opened.
-
Well, the first thing that would help is putting what have there inside tags and put the error in tags. That way it can at least be easier to read what's going on.
-
Ok, so I edited bballintvgn1, ID 3452, and when I look ingame, the textures are kinda messed up. Notice how the bballintvgn2, ID 3453, also has a little bit of the same problem. What can I do to fix this? http://puu.sh/o1qXL/1fb8a53c09.jpg
-
Ok, so I made an edited .dff and an edited .col for a certain model. I used certain functions to load and import the .dff, .txd, and .col. The script starts up with no problems. All the edited stuff is there. However, when I stop the resource, the original .dff and .txd come back, but not the .col. The model loses all its collision. This happens in Map Editor, but not while doing using play resource. Why is it doing that?
-
Hey, I'm using Collision/Scale Manager, but everything I click CSM.lua and click yes, I keep getting What am I doing wrong?Edit: Solved the problem by adding the rights to ACL.
-
How do I disable an ac in my mtaserver.config? This is what it looks like: When I open acpanel, it shows that 1 is disabled, but not 4. What am I doing wrong? And I'm using MTA 1.3.5.Edit: Oh, I just figured it out. Can't have spaces in between the commas. That's why it wasn't working.
-
Yeah, now it works. Thanks.
-
That doesn't seem to work because unpack expects a table, not a function. But in this case, it said it was nil. Not sure why didn't say "got function". Client side: addEventHandler("onClientResourceStart", resourceRoot, function() --object = createObject(1318, 0, 0, 4) --moveObject(object, 5000, 0, 0, 20) object = createObject(1318, 0, 0, 4) time = 5000 local x, y, z = 0, 0, 20 moveObject(object, time, x, y, z) --local table1 = {object, time, x, y, z} --outputChatBox(tostring(unpack(table1))) movingData() end ) local moveObject_ = moveObject function moveObject (...) movingData = {...} moveObject_(unpack(movingData_)) setElementData(movingData[1], "moveObjectEndTime", getTickCount() + movingData[2], false) end addCommandHandler("test1", function() if getElementData(movingData1[1], "moveObjectEndTime") then outputChatBox(tostring((getElementData(movingData1[1], "moveObjectEndTime")))) elseif not getElementData(movingData1[1], "moveObjectEndTime") then outputChatBox("Not properly set") end end ) local screenWidth, screenHeight = guiGetScreenSize () -- Get the screen resolution function thing() if getElementData(movingData[1],"moveObjectEndTime") > getTickCount() then state = "moving" else state = "idling" end dxDrawText ( "You are " .. state .. "!", 40, screenHeight - 40, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "default" ) end addEventHandler("onClientRender", root, thing)