-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
@FIY9AL You could also add: function displayCountDown(hh, mm, ss, format, countdownFin) if countdownFin then countdown = setTimer(countdownFin, direction+1000, 1) end Else there the callback function is very static.
- 1 reply
-
- 3
-
-
-
The event onClientResourceStart tells the client/player that a resource has been started on his computer. Then you can use triggerServerEvent directly after that to inform the server that a resource has been loaded on a client his computer. By adding these players to a table, you specify which players are loaded: local loadedPlayers = {} loadedPlayers[#loadedPlayers + 1] = player triggerClientEvent ( loadedPlayers, "eventName", resourceRoot) This only matters when an instruction send in the past is relevant momentarily and can't it be predicted without synchronizing with the server. So the instruction is: the server tells a player that a ped has to be muted. But a specific player didn't load his script. So he isn't aware of that instruction. The player loads from this moment his scripts. The following question is: Does this instruction to mute a ped, is relevant for this player? Because the ped isn't muted for him. Based on the reaction on your previous reply, it is a YES. Can this player that didn't receive the instruction, predict the instruction that should have been executed on the ped? A: If all peds have to be muted within the resource. Then yes, you can predict this instruction and disable clientside the voices of all peds of this resource. Note: something similar might have been added to this resource already. addEventHandler("onClientResourceStart", resourceRoot, function () setPedVoice(resourceRoot, "PED_TYPE_DISABLED") -- mute all current peds of this resource. This does not include new created once. end) B: If that is not the case, then I do not have 1,2,3 a solution for you. You need to keep track which peds are muted and which are not.
-
It occurs when you use triggerClientEvent on a player that isn't finished downloading or loading it's scripts. In most cases it can be ignored. In your case it means that your zombie isn't muted for a specific player. If you want to optimise it, you should keep track of loaded players and only send messages to that segment. And also send a message to new loaded players. It is a time consuming fix, unless it was correctly done from the beginning.
-
@Adolfram See event open in: https://nodejs.org/en/knowledge/advanced/streams/how-to-use-fs-create-read-stream/ In that example they pipe it when the readable stream is ready.
-
Yes possible. You can counter that with the second example of this page: https://wiki.multitheftauto.com/wiki/OnElementDataChange In my opinion it is bad practice to save money and items in element data. You can use it for displaying those information of course, but I do not recommend to use it as the basic of a saving system.
-
You can put the delay on either Node.js or MTA. Not sure what the best solution is. For MTA: setTimer(function () sound = playSound ( url, false, true ) end, 100, 1)
-
Yup, I just failed to understand that it was for streaming and not fetching on a stream. ? In the past I created a custom html player, which sometimes failed because the meta data (...length of the audio...) wasn't sent quick enough. Which is not the same as your problem, but it could be related. Maybe a little delay could do the trick?
-
Did you flush the file write? https://wiki.multitheftauto.com/wiki/FileFlush Because it possible that the file hasn't been fully written and that a piece of it is still in your memory. Or are you fully streaming?
-
Good question. How did you program it so that it waits until it is finished downloading? And did you make sure the file is created after the response and not before?
-
Interesting solution @Patrick , I am hardly using metatables so I have always trouble to get around the default table logic. btw I am wondering is the rawset function not required to set the value on line 26?
-
Hey people, how is prison?
In 2015 I released a beta version of a resource that created driving trains. But unfortunately I never finished it. So that is why I am making a final update for it, including rewriting and cleaning the old code.
The this version will be uncompiled, so you can adjust it like you want.
It will take some more days to finish it, so be patient.
I can send you a pre-version, if you like to try it out before the release. No requirements for a pre-version, just a little bit feedback would be nice. To receive the pre-version, send me a personal message and I will send you the version within 1-3 days.
The old topic:
-
I will somewhere this week publish a new version of this resource. Because I wanted to finish it at-least. Uncompiled Better optimised than previous versions. CPU (3,5-3,9 GHz) 4 trains +/- 1.22% usage 40 trains +/- 7.05% usage Overkill Cleaned up a lot of the old code (I wrote this in 2015.. , never the less it is still ugly :C) Added some custom train-cart designs. Fixed all known bugs. Trains won't stop, even in this version. But you can try to make that yourself... If you want to test it out, before I put it on the community, free feel to send me a message. But in return I did like to receive some feedback.
- 28 replies
-
- 3
-
-
- trains
- not compiled
-
(and 2 more)
Tagged with:
-
Locked (For making a script request) and acting like it is not a big deal with a topic bump, after you received the information you needed to know.
-
Locked reason: double post
-
I am not exactly sure what the raw mathematics are . But you can use for your first iteration this function: local screenPosX, screenPosY = getScreenFromWorldPosition ( x, y, z, 10, true ) if screenPosX and screenPosY then end It will flatten the complex 3D orientation and therefore allows you to calculate the rotation: https://wiki.multitheftauto.com/wiki/FindRotation
-
Did you assign an ID to the object? Afaik you to add (manually) id's with setElementID.
-
Nope, just the way you are doing it in your example. A flat structure, because each complexity in the structure will make it more complicated to save. You can later add a next layer on top of your table, to improve searching performance, if you so desire. Finding your item? Do it how a human would do, check every item in the list until you find the right one and stop searching.
- 1 reply
-
- 2
-
-
-
Options: A. use the command: /refreshall B. Empty your client cache MTA San Andreas X\mods\deathmatch\resources Source:
-
hmm, it is kind of a strange error. Since freeroam doesn't request the files from the path /data/ rows={xml='stats.xml', attrs={'name', 'id'}}, File fr_client.Lua. Line 461 This error is showing when starting freeroam or always?
-
And are the files inside?
-
Those files are located in: \[gameplay]\freeroam Try to unzip the resource (and delete the zip)
-
@anlaltnay Download the latest freeroam resource from: (after downloading, located in [gameplay]) https://github.com/multitheftauto/mtasa-resources
-
You can use the addCommandHandler. addCommandHandler ( "givemoney", function (responsibleElement, commandName, teamName, money) iprint("givemoney command used") if responsibleElement and getElementType(responsibleElement) == "console" then iprint("the one used the command is the console") money = tonumber(money) if teamName and money then iprint("parameters are valid!") -- do your stuff end end end)
- 1 reply
-
- 1
-
-
In most cases not. It does indeed reduce memory, but that only matters when the variable contains a lot of data. For example: A variable that contains a table reference with > 1000 items. Cleaning this data will not boost your performance directly, it will only allow your users to use less HDD memory when they do not have enough ram installed. Which will indirect result in improving the performance. People with 4 gb ram installed on a windows 10 computer, that is segment you are helping.
