Jump to content

Driggero

Members
  • Posts

    75
  • Joined

  • Last visited

Posts posted by Driggero

  1. 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 :D

  2. 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.

  3. 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) 
    

  4. 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.

  5. 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 :)

  6. 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 :)

  7. 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?

  8. 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 :P

  9. 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 :P

  10. These:
    showChat 
    showPlayerHudComponent 
    

    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 :)

  11. 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...