Jump to content

Driggero

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by Driggero

  1. Looks great of course... but not as great as you :*
  2. Driggero

    fetchremote

    It's perfectly possible yes. Dealman's referring to a resource I made for my team's servers with the help of another guy. Truth be told it was the other guy who handled all the HTML code, I just built the resource around it. What you need is to find a site that stores the song links in the HTML data, so that when you you get the callback from fetchRemote you can go through and find that link and play it on the client. It's a lot of work and there aren't many sites that store the song links that way either. But it's certainly doable (just like Dealman). You're welcome to PM me if you want any more info. I also may end up releasing the resource we made at some point in the future too
  3. Oh no you di'int Code is fine though, you're just not triggering the event.
  4. More screenshots! But yeah, lookin' good Deal (and the gamemode, ofc).
  5. You have to export it inside the original resources' meta file, then use the exports function (call) to use it from other resources. As far as I know there is no way to actually hard-code it so you can just use it like the built in MTA functions though.
  6. http://michalfapso.blogspot.co.uk/2012/ ... peech.html There are tonnes of languages for it, however I've gotta warn you only 10-15 of them are any good. The rest are really rather poor.
  7. setElementData is lost when the player leaves (since the player element is removed). If you want to save the data for when they rejoin you need to use either a database, XML file, or setAccountData. You can't rely on setElementData to save anything for longer than the player remains connected to the server.
  8. function daspawnzon() if not spx then outputChatBox("#E3E8B7The command will be available once the map is restarted!", 0, 0, 0, true) else local car = getPedOccupiedVehicle(localPlayer) if not car then return end setElementFrozen(car, false) setElementModel(car, model) --setTimer(setElementFrozen, 2500, 1000, car, false) setElementHealth(car, 1000) setElementPosition(car, spx, spy, spz) setElementRotation(car, sprx, spry, sprz) triggerServerEvent('syncModel', resourceRoot, car, spm) end end addCommandHandler("RES", daspawnzon)
  9. There are other ways to do it, but this is one method: function countdownFin() --whatever you want to happen here end local countdown = setTimer(countdownFin, 600000, 1) --set the timer for 10 minutes setTimer( function() local x = getTimerDetails(countdown) local timeLeft = math.ceil(x/1000) outputChatBox(convertSecondsToMinutes(timeLeft)) end, 1000, 0) function convertSecondsToMinutes(sec) --turn the seconds into a MM:SS format local temp = sec/60 local temp2 = (math.floor(temp)) --this equals the minutes local temp3 = sec-(temp2*60) --and this is seconds if string.len(temp3) < 2 then --make sure it's displayed correctly (MM:SS) temp3 = "0"..tostring(temp3) end return tostring(temp2)..":"..tostring(temp3) end EDIT: Just quickly tested it and fixed a tiny bug. The code works now.
  10. Driggero

    Scrollbar

    onClientGUIScroll()
  11. guiGetScreenSize() gives you the size of your screens resolution. So if for example it was 1024x768, You'd know that 500 lengthways is about center. Same goes for widthways, ~370 would be close to center there. I usually use that when I'm trying to estimate where to place an image on screen. I highly recommend NOT using single values like that though (such as 500 or 370) as what is in the center on one resolution will not be on another. Instead I'd do something like this: local x, y = guiGetScreenSize() local middleX, middleY = x/2, y/2 That way it will scale to all resolutions. This is just an example of centering images, but you get the idea
  12. Yes, but so is playSound and all the other audio functions. The idea is you trigger the event from the server to ALL clients, then every client hears the same sound (if they are within distance).
  13. What's wrong with just using playSound3D? You could get the players distance from the sound and set the sound volume lower the further they are away, but why go to the trouble when playSound3D does it all for you?
  14. You can still talk to other players from different servers through the callRemote() function. Honestly the only advantage multigamemode has is possibly cheaper hosting. And that's assuming that it doesn't put excessive load on the server in the first place. That and the fact it's a pretty gimmick. I've yet to see a multigamemode server as good as the original FFS one, and although I appreciate how much work people put into these scripts, I think it's a lot of wasted effort trying to copy one server instead of introducing some variety. Again I'm not hating on anyone. Creating a multigamemode lobby is a brilliant achievement, I'm just sick of people coming on these forums and begging for this specific script instead of thinking creatively
  15. My advice: stop trying to copy other servers with this multigamemode hype and make something yourself. Hey, you could even be original while you're at it. That way every server is a different experience with something new to offer. Now that's much better than a bunch of FFS clones which all offer a pale imitation of the same server, don't you think?
  16. Your script is client-side so you can't use the function setElementVisibleTo.
  17. I'd try checking through the countdown_client.lua and maybe the textlib_anim.lua Race isn't all that easy to navigate I'm afraid.
  18. addEvent("onClientMapStarting", true) addEventHandler("onClientMapStarting", root, function() for i, v in ipairs(getElementsByType("sound")) do destroyElement(v) end end ) not tested, you may need to wait a few seconds after the map has started. EDIT: Looks like Dealman beat me to it, that should work perfectly
  19. mapName2 isn't a string. Which means the problem lies outside of the code you posted. Whatever mapName is it's not a string, and hence mapName2 isn't either.
  20. string.len is what you need. Detect the length of the string in question and if it is above a certain length then don't draw it
  21. Believe you can do this with shaders, though I don't know the exact method. Could also screencap the image and then manually blur it and draw it later with dxDrawImage. However, the best solution would be to be original
  22. These will hide the chat and the radar but you'll need to edit race if you want to hide everything (the timelimit, rank, healthbar etc). Inside the race_client.lua you should add inside a new function: hideGUIComponents('timeleftbg', 'timeleft', 'healthbar', 'health', 'rank', 'ranknum', 'ranksuffix', 'checkpoint', 'timepassed') I think that's all of them but if you've customised race at all then you will need to add/remove things. Then you can either export that function and use it from another resource or just put the controls directly in the race_client. Good luck
  23. setElementData You literally just set the players element data for whatever the scoreboard column is called to the value. In other words: If your scoreboard column is called "money", then you would do setElementData(playerElementHere, "money", moneyValuehere)
×
×
  • Create New...