Jump to content

Driggero

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by Driggero

  1. Driggero

    Map list

    You can use: maps = exports:mapmanager.getMapsCompatibleWithGamemode() to get the list of maps. Then you do a loop through the maps table and add them to a gridlist within a GUI
  2. Hey everyone. I'm looking for a way to disable a texture that has been applied to an object by engineLoadTXD() and engineImportTXD() without having to turn off the resource. I've checked the wiki and there seems to be no function to actually do this, which is odd. engineRestoreModel() does nothing, trying to import nil as the TXD does nothing. It seems really silly to add a function that does something, without another way of undoing it. Does anyone know a way that this can be done, without restarting or turning off the resource? Would be much appreciated.
  3. Driggero

    Nametag

    I think this is something you edit in another resource (possibly race). But adding setElementData(localPlayer, "state.hud", enabled) to the top should do the trick also. Could be wrong though, just quickly browsed through the first few lines. On further inspection I'm almost certain what I posted above is wrong I think removing the if statement on line 54 (not the code in it, just the if and end) should do what you're looking for.
  4. People should assume that anyway. This forum is for help and support with scripts people are working on, not for requesting scripts for free without putting any effort into them themselves.
  5. Driggero

    help

    addCommandHandler("car", function(player) local randomNumber = math.random(1, 100) if randomNumber == 1 then --give them a car or whatever you like here, remember to give it to the "player" variable outputChatBox("You've won something!", player) end end )
  6. Try something like this: local progress = 100 local newProgress = progress*6.08 addEventHandler("onClientRender", root, function() dxDrawRectangle(316, 649, 615, 38, tocolor(13, 115, 0, 255), true) dxDrawRectangle(320, 653, 605, 29, tocolor(0, 0, 0, 255), true) dxDrawRectangle(320, 653, newprogress, 30, tocolor(229, 0, 0, 200), true) end ) EDIT: Just now noticed TAPL's post which is essentially doing the exact same thing, feel free to ignore this
  7. Say the longest length of rectangle 3 is 100 pixels, this is the length it will be when full. local progress = 1 x, y = guiGetScreenSize() dxDrawRectangle((x/2)-50, y/2, 100, 5, tocolor(0, 255, 0, 100)) dxDrawRectangle((x/2)-50, y/2, progress, 5, tocolor(0, 255, 0, 255)) So you just need to set the progress to whatever number between 0-100 you want it to be. Bear in mind that if your bar is not 100 pixels then you will need to convert the progress into a percentage of whatever the bars full length will be.
  8. You can't use the GUI progress bar if you want it to look like that. As Dealman says use the drawing functions, along with some math to make it draw correctly. Specifically these dxDrawRectangle dxDrawImage dxDrawText
  9. resourceRoot gives the same result as this :~..... getResourceRootElement(getThisResource())......... resourceRoot is the output of those 2 functions. Oh really? Apologies then, I thought it only gave the output for the first function. Nevermind
  10. If you're looking to move the text from one position to another, or one scale to another (anything you can edit about it really) then you can use interpolateBetween Combined with the several easing functions you can make all sorts of animations with this function
  11. Better yet.. addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), You don't want any other resource restarting to effect it, right?
  12. What he said was quite interesting and useful. I'm certainly thankful he posted that here. You've already received quite a lot of useful advice from this thread too, If you are more appreciative perhaps people will be more willing to help.
  13. Driggero

    question

    I honestly can't see why you'd need to query anything every 100ms, that's 10 times a second. Unless what you're doing is extremely lightweight (which i'm assuming it's not since the crashes) then you're gonna cause problems . What are you trying to do?
  14. Driggero

    question

    You're going to cause massive lag if you set a timer to do most things 15 times a second. I'm sure whatever you're querying will work just as well if you do it once a second or even once every 5 seconds. If your server crashed with that error then there's your proof. You should get into a habit of not using timers unless you absolutely need to, as they are not the most efficient way of doing things
  15. These functions are all server side only. isObjectInACLGroup getAccountName getPlayerAccount aclGetGroup You'll need to place them in server side code and trigger that back to the client.
  16. You choose which player it will show for before you add the event handler, as pa3ck has done in his code. The event handler itself has to be on the root element or it won't work.
  17. Why are you using getRootElement(localplayer) Just use getRootElement() and it will work fine
  18. What the sexy schmuck above me says is correct. They both work in relation to accounts and just return different values. The MTA wiki is your friend
  19. I may be wrong but I think from far away it displays the LOD image, which is like a lower resolution image to increase performance. There are ways of setting this enabled for your custom object too I believe, but you'd have to check the wiki and find out exactly what each of the functions do. Some of these may be helpful, though I've never used them before myself. engineSetModelLODDistance setLowLODElement isElementLowLOD
  20. If you just want a script that draws text in the bottom right corner of the screen then you can accomplish that easily with the dxDraw functions. If you're not savy with scripts then you can even use this https://community.multitheftauto.com/in ... ils&id=141 which does all the hard work for you. However if you're looking for a map shop and something that saves checkpoints that will be a lot more work
  21. You can use this event to get the exact position of the explosion, not sure if that's what you're asking. onClientExplosion
  22. Driggero

    Need help

    It should work in the map editor too. Are you sure the music file is in mp3 format and placed inside the map folder? If so then there may be a syntax error. Open up the debugstring with /debugscript 3 and see if the resource loaded correctly.
  23. Driggero

    Need help

    create a file called music.lua and add this to it function startMusic() setRadioChannel(0) song = playSound("music.mp3",true) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("mkmap1_racetheme",toggleSong) bindKey("m","down","mkmap1_racetheme") Place your music file in the same folder as the map and call it music.mp3. Next you need to add these 2 lines into the meta: <file src="music.mp3"></file> <script src="music.lua" type="client"></script> Then you're done
  24. Do you want to change it or simply disable it? Because you can disable it very easily in the scoreboard client settings.
×
×
  • Create New...