ixjf
Members-
Posts
647 -
Joined
-
Last visited
Everything posted by ixjf
-
One little thing there is that your hasbit function is not necessary. MTA has built-in support for bit manipulation - both bitAnd and bitTest will do that job, the latter being just a wrapper for bitAnd ( ... ) ~= 0. I wrote a smaller alternative to your function: function removeMultiByteChars ( str ) local asciiStr = "" for i = 1, utfLen ( str ) do local c = utfSub ( str, i, i ) if not bitTest ( 0x80, string.byte ( c ) ) then asciiStr = asciiStr .. c end end return asciiStr end It can be used in the same way as yours: removeMultiByteChars ( "[DM] Packy Ѡ vol.13 Ѡ Defiance Ѡ" ) -- such should return "[DM] Packy vol.13 Defiance "
-
You know what. I think your friend doesn't know what a data center is
-
(login remember me system)Are MTA Serials 'reliably unique'?
ixjf replied to LonelyRoad's topic in Scripting
Impossible. Is it, though? Are you saying you know better than the MTA developers themselves how their own system works? Would be nice if you could justify your opinion. Also, don't forget this is probability, not precise data. -
(login remember me system)Are MTA Serials 'reliably unique'?
ixjf replied to LonelyRoad's topic in Scripting
It's not about being lazy, it's about who is responsible for what. If they tick a check box to remember details, they should know that anyone with access to the computer can at least log in to their account. That's how things have been done for a long time and I have rarely seen any issues with it so I don't see any real benefit from encrypting the password. -
(login remember me system)Are MTA Serials 'reliably unique'?
ixjf replied to LonelyRoad's topic in Scripting
Why would you need to? It's the client's responsability to keep his files safe. -
(login remember me system)Are MTA Serials 'reliably unique'?
ixjf replied to LonelyRoad's topic in Scripting
There is a very small risk of serial conflicts. According to Talidan, approximately 500 other players have the same serial - that is a 0.1% conflict rate. -
No, no, no. Coroutines make no sense for this purpose. What you need to do is count the times the player has clicked the button "OK" - every time it is pressed, you grab the text from the edit box and you add it to the table. Once it reaches 5, you stop it - you handle it however you want. So, something like this: local someTable = {} local GUI = {} local clickedTimes = 0 function createGUI () -- Create the GUI however you want GUI.editBox = guiCreateEdit ( ... ) GUI.buttonOk = guiCreateButton ( ... ) addEventHandler ( "onClientGUIClick", GUI.buttonOk, onOkClick, false ) end function onOkClick () if clickedTimes < 5 then -- You can handle user input here, for instance, check if the player has actually -- written anything on the edit box at all by checking if the length of the string returned from guiGetText is higher than 0 table.insert ( someTable, guiGetText ( GUI.editBox ) ) clickedTimes = clickedTimes + 1 end end
-
J.S., unless I'm outdated, which I might be since I've been inactive for some time, the global whitelist is just a list of known safe websites that are always accessible, without the need for the user to allow the server to load it (Google, YouTube, Reddit, for instance) - the server may request the client to open any webpage.
-
That makes completely no sense. Regarding the OP, I don't want to steal the topic, but you can as well use kikito's tween library which has far more easing functions built-in (and allows you to specify your own easing functions if you want) - it was made based on LOVE's design, though it can easily be ported to MTA since it has no specific code from it. All you need to do is remove "return tween" from line 379 and make the table "tween" defined at line 7 global. To use it, just call tween.update in the event onClientPreRender, passing the argument dt to it. Then you can use tween.start, tween.stopAll and all the other functions normally. Example of usage: addEventHandler("onClientPreRender", root, function ( dt ) tween.update ( dt * 0.001 ) end) -- taken from tween's doc -- increase the volume of music from 0 to 5 in 10 seconds local music = { volume = 0, path = "path/to/file.mp3" } tween(10, music, { volume = 5 }) -- make some text fall from the top of the screen, bouncing on y=300, in 4 seconds local label = { x=200, y=0, text = "hello" } tween(4, label, { y=300 }, 'outBounce') -- fade background to black in 2 seconds, and then print a message on the terminal local backgroundColor = {255,255,255} tween(2, backgroundColor, {0,0,0}, 'linear', print, "hello!") Regardless, the idea is nice, and there is absolutely no problem with using "classes".
-
That doesn't make other players able to see your animations. Custom animation support is not going to happen in MTA any time soon (at least not that way) - you've been told this countless times, yet you keep on spamming the forums and the bug tracker with this. If you can't understand how things work and you can't do anything yourself either, then all you can and SHOULD do is wait patiently until such feature is in such a state where the MTA team can consider releasing it already. Currently, custom animations are buggy and nobody has got the time, motivation to work or don't feel like putting that amount of effort on it, that's why loading custom IFPs was disabled. I remember you were also told this.
-
Are you using the 1.4 client? Those functions are not available prior to that version.
-
Holy shit, what this topic has come to.
-
As I already said, MTA has built-in MySQL support - there's no need for any modules.
-
There's no need to use any modules - the only thing required is the libmysqlclient.so.15 Linux package.
-
You could rather block all resources from calling outputChatBox except the ones you want, through ACL. I suppose the default group for all resources and users is "Default" - block access to the function: <right name="function.outputChatBox" access="false"/> .. and then add the resources you want to have access to the function to another group that allows access to it.
-
I think that's a bit obvious. It has to parse the XML file, file functions are for raw editing. Performance vs. readability, elegance and relatively low complexity - the latter clearly wins. You will most certainly not notice the performance impact.
-
Or rather use the XML functions.
-
? ? ? i see most server owners request this feature in this Forum or anywhere You could be learning to program the time you're here requesting useless shit.
-
Follow the steps mentioned in any of the answers here: http://stackoverflow.com/questions/1732 ... n-debian-7
-
It is obvious that you're missing a dependency of the sockets module - libssl 0.9.8. Install this package first and retry.
-
Exports are for inter-resource communication, and you cannot call server exports from the client, nor vice-versa.
-
1GB of data files? Certainly nobody will download 1GB to play on your server. It's not MTA at fault here, it's you.
-
Another option is something like the 2nd solution - I don't know how you would implement that, but, in my opinion, instead of hardcoding blocked websites into MTA's source, it would go through a proxy hosted on the MTA servers which filtered websites, this would allow for easier maintenance, rather than changing the source to block another website. On the other hand, page loading time would increase. The first solution isn't bad either, but even though you will need to maintain the proxy server, I think the second solution is still best. By the way, looks great!
