-
Posts
866 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mr_Moose
-
You can host 24/7 on your own PC without any issues, just don't use your own client machine for that because they aren't made to run 24/7, basically any hardware works, just make sure it has a proper cooling system, is quiet and doesn't use much power and you'll be just fine. I usually build my servers in full tower cases with lots of large fans running at low speed and low power consumption. On the software side it's important to use a proper server OS like Linux Debian without GUI or maybe Windows server (if you aren't used to terminals and can afford it). You should also virtualize as much as possible and make sure you spread backups wisely over your network. A fast network is also preferable, at least 10mbt/s and fiber cable, do not use a wireless connection for a server because that will affect the ping.
-
You added a timer inside an onClientRender event with the wrong syntax. This is a valid way to define a timer: setTimer(function() -- Code here end, 10000, 1) Move it outside the render event to hide the text after ~10 seconds (if that's what you're trying to do), as you do now it will attempt to hide the text 600'000 times after 10 seconds during 10 seconds, that's not a good idea.
-
This will also require a correct configured webserver, if php isn't installed your code may be seen if someone does view source in the browser, this is usually not a problem on external hosts but if you host by yourself, make sure php is installed properly.
-
The bottleneck is obviously the memory, are you sure it's not 128GB? 128MB will only hold the operating system (Debian 7.0), luckily MTA servers generally doesn't use to much RAM by default. That CPU will be really over powered in this system even if it runs on ridiculously low frequency. And the bandwidth is just fine, it's bottleneck will limit it to 10mbt/s thought since servers usually has a similar download and upload speed. In short this configuration looks like a pure scam to me but despite the low memory you should still be able to have around 20-30 players without lag if you run a non resource intensive game mode like free roam maybe, generally you can't say how many players a server with some given specifications can handle, it's all about what resources you run on it and how optimized they are, a badly written resource could cause extreme lag even if you're alone, you also have to count with other users since many users may be on the same server while using VPS, if they do heavy calculations and stuff you might not get all the performance you pay for either.
-
Hamachi is a VPN software which creates a tunnel between your network and another local network, if you're goanna host a public 24/7 server Hamachi is worthless. Port forwarding refers to your router, that small box you have between your PC and the internet cable (fiber) or your modem (adsl). Iptables are the local firewall that comes with most Linux systems, if you have a router it probably have a firewall built in, which means you won't need to use iptables. You can easy disable it with this bash script: #!/bin/bash # reset.fw - Reset firewall # set x to 0 - No reset # set x to 1 - Reset firewall # --------------------------------------------------------------------------------------------------------------- # Added support for IPV6 Firewall # --------------------------------------------------------------------------------------------------------------- # Written by Vivek Gite <[email protected]> # --------------------------------------------------------------------------------------------------------------- # You can copy / paste / redistribute this script under GPL version 2.0 or above # ============================================================= x=1 # set to true if it is CentOS / RHEL / Fedora box RHEL=false ### no need to edit below ### IPT=/sbin/iptables IPT6=/sbin/ip6tables if [ "$x" == "1" ]; then if [ "$RHEL" == "true" ]; then # reset firewall using redhat script /etc/init.d/iptables stop /etc/init.d/ip6tables stop else # for all other Linux distro use following rules to reset firewall ### reset ipv4 iptales ### $IPT -F $IPT -X $IPT -Z for table in $(</proc/net/ip_tables_names) do $IPT -t $table -F $IPT -t $table -X $IPT -t $table -Z done $IPT -P INPUT ACCEPT $IPT -P OUTPUT ACCEPT $IPT -P FORWARD ACCEPT ### reset ipv6 iptales ### $IPT6 -F $IPT6 -X $IPT6 -Z for table in $(</proc/net/ip6_tables_names) do $IPT6 -t $table -F $IPT6 -t $table -X $IPT6 -t $table -Z done $IPT6 -P INPUT ACCEPT $IPT6 -P OUTPUT ACCEPT $IPT6 -P FORWARD ACCEPT fi else : fi Source: http://www.cyberciti.biz/faq/turn-on-turn-off-firewall-in-linux/
-
@Cmtv no you can't add the function handler before the function, you can add the function inside the event handler however like this: addEventHandler ("onMarkerHit", marker, function(args) -- Code here end) And on topic, 'source' in the 'onMarkerHit' event is the marker, 'hitElement' is the player in this case. Occupation is set to the marker, a topbar message is displayed... to the marker, and on the line after, you try to set the nametag color on the marker.
-
When your CPU usage is that high it's most likely badly optimized scripts, have you checked performance browser (http://:), to see which resource waste most of your servers performance? This is usually caused by bad third party resources where some idiot creates multiple timers doing heavy calculations inside an event triggering on player movement like on element stream in or col shape hit for example.
-
Since you have the root element in "onClientGUIClick" event it should work, (haven't tested it thought), another way is to add an invisible button on the same location: guiSetAlpha(element, 0)
-
I tried in a few browsers on Windows 8.1 with the following results: Firefox 33.1 Passed Opera 25.0.1614.68 Passed Chrome 35.0.1916.114 Passed IE 11 Passed All of them where able to scroll without any issues so I checked css.css inside the resourcebrowser folder, couldn't find any 'overflow' property which is what handles the scrollbar, if that's not set the browser will use a default value. First you may try upgrading your browser, then the actual resource, if none of those works open that css file again and add the overflow property inside the body tag: body { overflow:auto; /* Force scrollbars on overflow */ margin: 20px; padding: 0px; background: #000000; font: bold 1em "Trebuchet MS", Arial, sans-serif; } More info may be found here: http://www.w3schools.com/cssref/pr_pos_overflow.asp, good luck.
-
Try '/debugscript 3' and post the output.
-
I don't know any specific Christmas mod but snow mod by crystal might help you a bit on the way.
-
$1.50 sounds cheap, will that include a GUI and all Anyway, joking aside, downloadFile is the function you are looking for, either use that in every single resource to download pictures for example or a separate resource that handle downloads of any image based on the wiki example: function onThisResourceStart ( ) downloadFile ( "test.txt" ) end addEventHandler ( "onClientResourceStart", resourceRoot, onThisResourceStart ) This will basically start the download after the resource is started, after that you may use some kind of exported function to access the images downloaded from the image resource, the reason for downloading all images in the same resource is that it may be easier to calculate total download time and then display it during the download.
-
Check http://www.listenlive.eu/ for example, select a country for a list of available radio stations there and on the right column you'll find a couple of direct links to (n)kbps streams, urls that ends with .pls or .m3u for example are playable in MTA.
-
"onResourceStop" might not trigger if the server crash, it's better to use "onPlayerQuit", that works even if a player crash, it's also a good idea to save all player related date during intervals, say like each minute or so with a timer. "onResourceStop" will trigger whenever you restart or stop the resource or if you shut down the server the correct way.
-
Those bugs you mentioned should now be resolved, compare them here if you're interested https://github.com/GTWCode/GTW-RPG/commit/f2a8b3e6f5cb079a2bc55109c26b5fa54f829ccf
-
Bugs can be reported here: https://forum.404rq.com/bug-reports/ And suggestions here: https://forum.404rq.com/mta-servers-development/ About the chat, it sounds like a bug but I've never seen that before, it may be a crash that still trigger on events bug fails to disable the standard chat, that's the only thing I could think of when you're talking about double messages, GTWtopbar is available on github as well: https://github.com/GTWCode/GTW-RPG/tree/master/GTWtopbar, either download that or replace all exported calls to that resource with the function 'outputChatBox', the syntax are identical to make it easier to use. Guest thing seems to be located here (line 321, chat-s.lua): local loc = getElementData(source,"City") if not loc then loc = "Guest" end As we can see it's still a little bit depending on other systems since the city are gathered from element data, I should optimize this by using getZoneName instead so thanks for reporting it, it was a bug after all Smileys seems like a logical step in this, that could be the next goal after resolving these bugs.
-
The ability to chat with other players has always been an important feature, however the built in chat has it's limits and it's time to do something about it, GTWchat are based on the system running on the server with the same name, after optimizing the resource I decided to make it available to other servers as well, unlike earlier resources I made this will make sure a feature is supported before enabling it, in this case the various chats available. Features: So what features does it have so far? let's have a look at the list: Custom main and team chats, messages won't disappear if they are too long, instead they continue to show on a second output, by doing that, chat messages can be a little longer than default. Anti spam protection, delay between each message Anti repeat functionality, earlier messages are temporary stored in a table and cleaned up when the player leaves the server Local chat, visible to anyone within the radar area (radius 180) Group chat, (works if you have a group system running, it will also get the chat color from some group systems that support that kind of feature) Car chat, talk privately to people in the same vehicle as you Uppercase first letter, except url's. Chat bubbles, based on this by Dragon /me and /do for basic role play servers. Multiple commands for each chat, some are bounded to keys by default. All chats are visible to server staff All chat's are logged to server log Download link: (beta release) https://github.com/GTWCode/GTW-RPG/tree/master/GTWchat Suggestions, bug reports and general feedback can be leaved here: https://forum.404rq.com/
-
function giveWeaponToPlayer(thePlayer, cmd, weaponIDorName, receiver, ammo) -- ... end addCommandHandler("give", giveWeaponToPlayer)
-
That could be useful at a later point maybe, however building custom tracks is very hard if even possible, first you need to find a way to spawn a train vehicle as a "free" object that can exist at any location, (one of the solutions could be to attach it to another vehicle that aren't bound to railroads), when that works you need to build a system of nodes which force this vehicle object to follow it, current tracks are based on nodes as well but we can't access those. If you manage to make that work then you have a great start implementation of this idea.
-
From a security view it shouldn't be any difference, the point of false rather than undefined is probably a way for the server to output an error message in case of missing acl rights, for example if a resource without proper rights tries to kick a player you'll see something like "missing acl rights for group ... to perform 'function.kickplayer'". If it's undefined you have no ide which right is missing, if you're goal is to save space however you have most of the rights in default group already, all set to false, these applies to everything by default and after that new rights are loaded on top on that. So in short, you should be able to remove rights with the value 'false' from all other groups than default and only keep those who's value is 'true'.
-
Ops, that's what happens when you write one line and then then copy the next line above after realizing you done this before the example of getting an element speed in mph are in the wiki btw, I would rather use kmh but it doesn't matter. https://wiki.multitheftauto.com/wiki/GetElementVelocity, thanks for the correction.
-
Without screen you can launch it as a background process. ./mta-server & ./mta-server > /dev/null 2>&1 However being able to access the console has it's advantages, and screen is one of the best tools for that. su root apt-get install screen After installation check this guide: http://www.computerhope.com/unix/screen.htm, for available commands and how it works.
-
Something like this should do it. function blowVehicleOnHit(loss) -- Calculate speed in mph local speedx,speedy,speedz = getElementVelocity(source) local actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) local mph = actualspeed*111.847 -- Blow vehicle if mph > 50 then blowVehicle(source) end end addEventHandler("onVehicleDamage", root, blowVehicleOnHit)
-
Use "/debugscript 3" in game, looks like there might be errors in the client side of that resource which has to be resolved. Client side errors could also cause the entire resource to fail loading and that usually returns the output you got.