Jump to content

Hugos

Members
  • Posts

    172
  • Joined

  • Last visited

Posts posted by Hugos

  1. Hi everyone! I created an array in which I pointed out street names. For example, Los Santos array: local location_ls = {"Vinewood," Marina, "Mulholland,"...}
    I need to perform one function when the player is in Los Santos. How can this be done?

  2. 1 hour ago, alexaxel705 said:

    https://community.multitheftauto.com/index.php?p=resources&s=details&id=14553
    Этот скрипт устанавливает свойственную регионам погоду.

    This script has its own regional weather base.

    
    local WeatherArr = {
    	["Los Santos"] = {0,1,2,3,4},
    	["San Fierro"] = {5,6,7,8,9},
    	["Las Venturas"] = {10,11,12},
    	["Red County"] = {13,14,15,16},
    	["Whetstone"] = {13,14,15,16},
    	["Flint County"] = {13,14,15,16},
    	["Bone County"] = {17,18,19},
    	["Tierra Robada"] = {17,18,19},
    	["UNDERWATER"] = {20},
    	["Unknown"] = {21, 22}, 
    }
    

     

    Спасибо)

  3. 1 minute ago, Dutchman101 said:

    It's a common question, but there is no answer for it, because it depends on your plans with the server.

    For example:

    1) The amount of players

    2) If you'll have heavy mods (and if so, the level of their optimization)

    3) If you have sufficient scripting experience so that you can optimize all of your scripts

    Obviously, if nothing is optimized - mods are bloated and scripts do what they do inefficiently, causing your resources to ask more from your server's CPU and RAM memory, you will start hitting the limits of your server's specs much quicker.

    On top of these unpredictable things standing in the way of giving good advise, a large gamemode just requires a server or PC with decent specs. It's trial and error, you will just have to estimate the type of machine required based on what you're planning to do, and see if it's running smoothly and continues doing so as the player count (popularity) grows. If not, start with optimizing your gamemode, and otherwise selecting a better host.

    * Note: the reason we can't give you a proper estimate on what kind of server specs you need even if you tell us about your plans, is because we don't know the level of optimization in your gamemode and obviously can't reliably take the word of its creator for it.

    @Hugos

    Mods optimized. Players like 4000)?

  4. Hi everyone! I don 't know if I wrote in the right section of the forum or not, but there was a question. Please tell me what the requirements are for the server to keep it from hanging and working well? I mean the hardware itself: Processor, RAM, etc.?

    + What speed should the Internet have? (25, 50, 100, 300, 1000 Mbps:) )

  5. 9 hours ago, Overkillz said:
    
    local yourtick = getTickCount()
    local alpha = 0
    
    function yourFunctionRendering()
    	local progresstick = getTickCount() - yourtick
    	local progress = progresstick/500
    	if progress >= 1 then progress = 1 end
    	alpha = interpolateBetween(0,0,0,1,0,0,progress,"Linear")
    	--NOW YOUR FUNCTION
    	guiSetAlpha ( yourWindow, alpha )
    end
    addEventHandler("onClientRender",root,yourFunctionRendering)
    

    Something like this. Remember that eachtime you need to update the animation you have to restart 'yourtick'

    And deal with the condition to fadeout. I've just give you an example of fadein without the condition.

    Regards.

    Thanks!

  6. 3 hours ago, MrTasty said:

    Most animations are driven by an easing function - the simplest of which is Linear, but you could write your own easing equation - for example, y = x+math.sin(6.29x) if you want to, but most likely you won't need it. If you want something to appear smoothinly, use the return of an easing function as the alpha parameter; if you want it to slide onto the screen, use it for x or y position.

    Oh, right! Thanks))
    And how I didn 't think of it.

  7. Tell me, are there options for animations such as smooth appearance or fading? (These are Animations that are NOT driven by type "Linear," InQuad, "etc.)?

     

  8. I had a problem. When I click on "body" I have a missing "go." What to do? Help.

    addEvent("PlayerJoined", true)
    function PlayerJoined()
        setCursorPosition(x/2, y/2)
        showCursor(true)
        body = guiCeateStaticImage(x/2-(y/(1080/280)/2), y/2+y/8.5, y/(1080/280), y/(1080/50), "gfx/go!.png", false)
        go = guiCreateStaticImage(x/2-(y/(1080/400)/2), y/2-(y/(1080/530)/2), y/(1080/400), y/(1080/530), "gfx/body.png", false)
    end
    addEventHandler("PlayerJoined", localPlayer, PlayerJoined)

     

  9. Just now, WorthlessCynomys said:

    If you set relative to true, then you have to provide values from 0.0 to 1.0 (think of them as percentages 0-100 of the parent element). So the first element you draw is relative to the parent which is the screen, so the first element is relative to the screen. The second element as the child (part) of the first is relative to the first one. That's all. That applies to all CEGUI elements, including staticImage.

    THANKS!

  10. Just now, WorthlessCynomys said:

    guiCreateStaticImage makes a CEGUI element.

    dxDrawImage draws an image with the lifetime of a frame. You have to call dx functions on every frame.

    Well. Can you tell me more about how to make the dimensions of the picture "guiCreateStaticImage" relative?

    I have an image with dimensions 400x530, I set "width" - y/2.7, how do I do to have "height" exhibited automatically?
    P.S: x, y = guiGetScreenSize()

×
×
  • Create New...