Hugos
-
Posts
172 -
Joined
-
Last visited
Posts posted by Hugos
-
-
-
Ok. Thanks you!
-
1 minute ago, stPatrick said:
https://wiki.multitheftauto.com/wiki/GetZoneName
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?
-
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? -
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}, }
Спасибо)
-
-
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)?
-
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:) )
-
-
Just now, JeViCo said:
First of all you should create ped using createPed function and teleport it to vehicle using warpPedIntoVehicle
In order to control ped, you should use setPedAnalogControlState
Not that. I want to create something like this:
https://www.youtube.com/watch?v=k0W5c7VZT-o -
-
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!
-
-
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. -
-
-
-
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)
-
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!
-
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() -
What is the difference between "guiCreateStaticImage" and "dxDrawImage." For example, I draw panel and buttons using images. What 's best to use?
-
Just now, Felix5k said:
with CreateBrowser
I got it. This means only when using "Browser." Thanks!
-
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?
-
Just now, Felix5k said:
THANKS!!!
Do you know if HTML and CSS can be used in MTA scripts?
Random?
in Scripting
Posted · Edited by Hugos
Did not understand a little. Can I see an example of a function that generates a random number in a range?
P.S: I use Lua random.match - https://www.gammon.com.au/scripts/doc.php?Lua=math.random (not api)