Jump to content

Dealman

Members
  • Posts

    1,421
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dealman

  1. Hey now, I wouldn't say it's useless. There's a few ways of dealing with this, one is to use a render target and one is to use tables. Just think about it logically, you most likely have a table containing the items that should be rendered - right? When you scroll down, you'll want to remove the top-most item which is most likely gonna be the first item in your table. So, you store those removed items in a 2nd table in case the user decides to scroll back up. It's all a matter of playing around with offsets and whatnot. Though I believe using a render target would allow for the smoothest transition, it all depends on how you want to approach it.
  2. Dealman

    Help

    If you can't even comprehend such a simple error message, I sincerely doubt this is a script of yours. Most of us on these forums love to help out, but when you're using a leaked script and outright lie about it to our face when it's blatantly obvious - that's a no-no.
  3. Well then you have everything you need, welcome to the wonderful world of scripting where you need to put effort into research and do trial and error. What in particular is it you need help with? Events for clicking within a certain area to simulate button behavior?
  4. You have a misplaced quotation mark just after the Z parameter for createMarker.
  5. size = size + scaling_speed* -- Might wanna remove that * If you use debugscript 3 you'll see errors like this.
  6. There is a sub-forum dedicated to tutorials here. Whether or not there's a tutorial for how to draw DX shapes and text I don't know, but it's fairly simple. You'll also want to check out Remp's GUI editor resource. Other than that you have the MTA Wiki which really is all you need!
  7. That function is being handled, but the event handler is at the bottom of the script. There's your problem, as I already told you it needs to be set as a server script. Because you're using the event onResourceStart which is server only.
  8. Could you show your meta file? Do note that onResourceStart is a server-sided event and as such, you need to make sure the script is listed as a server-sided script in the meta.
  9. Ah, znext beat me to it. I've written an example as well, I haven't tested it either but it should work. local group1Salary = 1000 local group2Salary = 2000 local group3Salary = 3000 local group4Salary = 4000 local group5Salary = 5000 local salaryTimer = nil -- If we store the timer we can easily access it later function Initialize() salaryTimer = setTimer(function() local allPlayers = getElementsByType("player") -- Get all the current player elements, and store them in a local variable for key, thePlayer in ipairs(allPlayers) do -- Loop through all the player elements, and store them in the temporary variable thePlayer if(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Group1"))) then givePlayerMoney(thePlayer, group1Salary) outputChatBox("You've received a salary of $"..tostring(group1Salary).."!", thePlayer, 255, 255, 255, true) elseif(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Group2"))) then givePlayerMoney(thePlayer, group2Salary) outputChatBox("You've received a salary of $"..tostring(group2Salary).."!", thePlayer, 255, 255, 255, true) elseif(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Group3"))) then givePlayerMoney(thePlayer, group3Salary) outputChatBox("You've received a salary of $"..tostring(group3Salary).."!", thePlayer, 255, 255, 255, true) elseif(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Group4"))) then givePlayerMoney(thePlayer, group4Salary) outputChatBox("You've received a salary of $"..tostring(group4Salary).."!", thePlayer, 255, 255, 255, true) elseif(isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Group5"))) then givePlayerMoney(thePlayer, group5Salary) outputChatBox("You've received a salary of $"..tostring(group5Salary).."!", thePlayer, 255, 255, 255, true) end end end, 10000, 0) -- This timer will trigger the included function every 10 seconds for an infinite amount of times end addEventHandler("onResourceStart", resourceRoot, Initialize) -- Run this function when this resource is started
  10. Use debugscript and it will tell you in detail what's wrong with the script. But from what I can spot, p is never defined and as such will return a null reference - resulting in errors. Another issue is that you're trying to call the variable as opposed to the function in your timers. For example; setTimer(salario3, 1000, 1) -- Variable setTimer(salario3(), 1000, 1) -- Function I would also recommend that you do not use the same name for variables and functions to keep things clean and not confuse yourself or others. Edit: I don't think any of your code is actually executed unless you left some code out. These functions, salario() and reset() are never triggered. You'll want to use an event such as onResourceStart for this.
  11. This is a much welcome change, I've worked a lot with IPS's forum software in the past and it's an absolute blast to work with. Great job
  12. Dealman

    3D dxDraw

    Yup, the wonders of render targets It should be far more optimized as well
  13. I encountered a similar problem when I was making a 3D web browser, if I recall correctly you need to tweak the faceTowardX, faceTowardY, faceTowardZ values of dxDrawMaterialLine3D. I don't currently have MTA installed so I can't do it for you - but that's the wonders of scripting. Play around with it
  14. Dealman

    3D dxDraw

    You can most definitely draw text in 3D as well, you'll want to check out getScreenFromWorldPosition for that. The same applies for drawing DX shapes such as rectangles.
  15. moveObject is a native MTA function. Simply rename your function.
  16. What exactly are you wasting $50 a month on? As far as I know Enjin is a free forum service and MTA servers are cheap as dirt. Did you get an entire VPS just to host an MTA server...?
  17. You're changing the width as well, don't do that. Only usize.
  18. Did you try what I posted above? Your issue was the math being incorrect, sounds like it still is.
  19. Sorry for the delay, not as active on these forums anymore. Try this; dxDrawImageSection(screenW*0.6340, screenH*0.0130, screenW*0.3551, screenH*0.5534, 0, 0, (((getElementData(getLocalPlayer(),"blood") or 0)/12000)*425), 425, ":DayZ/images/health.png", 0, 0, 0, tocolor(r, g, b, 170), false)
  20. You're not using it right, you're changing the width which is wrong. What you want to change is the parameter called usize. Since you always have it at 425, it will draw the entire image. And since you're changing the overall width instead of the section length - it gets squeezed like the picture you showed.
  21. Of course it's client-sided only, a server (usually) wouldn't have a keyboard.
  22. Of course you can click links using the DX browser, otherwise it would be utterly useless. To draw the DX Browser you use dxDrawImage, so you can easily change the size of it by storing the size as variables. You don't need to destroy it and re-create it.
  23. What mouse features don't exist? Anything you can do with CEGUI you can pretty much do with DX.
  24. Why not use the DX browser? If I recall correctly you draw it as an image, making resizing very easy. And you can do other fancy DX stuff with it
  25. Nice work! I like the clean design, but wouldn't it be better to make it so it's re-sizable using the cursor? Alternatively make it so if you double-click the top it'll fill the entire screen like a normal browser would? Other than that, great work
×
×
  • Create New...