# Hugos

Members

172

## Posts posted by Hugos

1. ### Random?

I created the function math.random (10, 20), but I get 10 all the time. Help please! How do I always generate different numbers?

2. ### Check zone

Ok. Thanks you!

3. ### Check zone

1 minute ago, stPatrick said:

```
local x, y, z = getElementPosition(player)
local zoneName = getZoneName(x, y, z, true) -- only the city's name

if zoneName == "Los Santos" then
...
end
```

So this code will work if the player is in areas that are specified by a single array?

4. ### Check zone

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?

5. ### Weather

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},
["UNDERWATER"] = {20},
["Unknown"] = {21, 22},
}
```

Спасибо)

6. ### Weather

Please tell me if it is possible to set the weather for a certain region (LS, SF, LV)? So that everywhere is different, not the same.

7. ### Server (requirements?)

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

8. ### Server (requirements?)

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

9. ### Save time

Hi everyone! Please tell me how to save time to log file when the server is shut down? (It is necessary that at shutdown)

PS: fileWrite(create, ...)

10. ### NPC

Hi. Tell us what features are needed to create NPCs that can walk and drive?

11. ### Animate

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")
guiSetAlpha ( yourWindow, alpha )
end
```

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!

12. ### Animate

Help! I can 't understand how to set up "guiSetAlpha" with "getTickCount."

13. ### Animate

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.

14. ### Animate

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

15. ### help

Just now, DNL291 said:
```
guiSetEnabled(image, false)
```

Thanks a lot!

16. ### help

I realized what the problem was. When you click on a picture, it gets to the foreground. How do I fix it?

17. ### help

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

18. ### Draw image?

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!

19. ### Draw image?

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

20. ### Draw image?

What is the difference between "guiCreateStaticImage" and "dxDrawImage." For example, I draw panel and buttons using images. What 's best to use?

21. ### DX rectangle)

Just now, Felix5k said:

I got it. This means only when using "Browser." Thanks!

22. ### DX rectangle)

Just now, Felix5k said:

yes you can use html in mta

And how do I write hrml and css, create files and connect to *.Lua or how?

23. ### DX rectangle)

Just now, Felix5k said:

THANKS!!!

Do you know if HTML and CSS can be used in MTA scripts?