Jump to content

Mr_Moose

Members
  • Posts

    866
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mr_Moose

  1. Table remove function expects a number as argument #2, not user data, in an "ipairs" loop the first member '_' is the index and 'v' the value, that means you can replace line 22 with this: table.remove (timers, _) Also consider changing the variable name '_' to something else as it doesn't look very professional and may fail.
  2. Show the code, maybe you have a conflict somewhere that alter the value.
  3. That's strange as the interval should be between 1 and 0, what server and client version do you use? On 1.4.1 it works without any issues. (0.1 = 16km/h).
  4. Launch a big Hyper-V rig with a bunch of virtual machines, all running Windows 7, 8 or 10, install GTA SA then MTASA in all of them and let them connect to your server. Technically that's all you need to "fake" the players, to keep the real players stay on your server you need a pretty good excuse why everyone is idle all the time. But joking aside, CrystalMW has the solution you may be looking for in shape of pedestrians and traffic using peds driving/walking around in nearby areas. Download it here. I wrote a train bot system as well which is available here. These brings some more life to your server when someone feels alone.
  5. Take a look at GTWcivilians, a type of job system which you may use as source for inspiration: https://github.com/GTWCode/GTW-RPG/tree/master/%5Bresources%5D/GTWcivilians Also, this isn't a request section, you can ask for help if you face any issues however, good luck.
  6. Those lines seems correct but has a little confusing syntax, use "exec" (as in dbExec) instead of "query" on line 52, when updating that way. The same issue has been described in other topics recently, not for object orientated resources but the same rules applies to them.
  7. Your local IP is provided by the DNS server in your router and your router has a firewall to block external services from tracking your local IP's, at least until IPv6 i released. This is because there isn't enough IPv4 addresses available to all devices connected to the internet, forcing some devices to share one.
  8. Check the index at each level, everything that has a value is true while false and nil (no value) means false in below if statement. if not table or not table[randomIndex] or not table[randomIndex][2] then return end
  9. First of all you may notice that this function is available both on the server and the clients. By getting the tick count when a task is started, and then subtract that time from the current tick count when a task is finished you'll get the time it took to execute that task. This is certainly useful to measure performance on your system, which may help you to find bad resources that has a high CPU usage for instance. It can also be used for basic timing operations (using the method described above) like having a label, informing the players how much time it took to load something. Maybe you want to measure playtime to track the player stats on your server, there are many ways this function can be used. If you're creative Edit: corrected a few spelling errors.
  10. The map editor uses another dimension than 0 by default but saves to dimension 0 if nothing else is specified, the easiest way is probably to just map in dimension 0 and then edit the map file in your text editor by adding the dimension properties to every element in there later. Maybe you're trying to add stuff into an interior? if that's the case you may use the admin panel or similar to switch to the dimension you wish to map in, and then create your map there. Even if you'll have to edit the file manually later you can still see a preview of your map in the correct dimension.
  11. Mr_Moose

    GUI problem

    Use relative values on all GUI elements, set the last argument (use relative) on all GUI elements to "true". That allow you to set a value between 0.0 and 1.0 where this range represent any screen resolution.
  12. This kind of issues are usually caused by spelling/syntax errors, your code looks just fine and seems to be according to the syntax from what I can see, what if you run those lines directly to the SQL browser? does that cause any SQL errors for you? Maybe this could give you some help: https://www.sqlite.org/foreignkeys.html.
  13. Your client side code will finish execute before the server code start's to execute, as you have a ping around 50 this means a ~50 ms delay which in reality means that you set the skin ID to 287 (only you will be able to se that as it's client side). Then, 50ms later the spawn function on the server is triggered: bool spawnPlayer ( player thePlayer, float x, float y, float z, [ int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam = nil ] ) As you can see here, skinID is an optional argument in the spawn function which you haven't provided, that means it will set your skin to 0 (also known as CJ). So basically your code works, it does change your skin, but it also turns it back to CJ a few milliseconds later. I recommend you to set the skin either after calling the spawnPlayer, or supply that as an argument.
  14. As a table from a database is built on a various amount of rows but a constant amount of columns you can use a loop function like pairs or ipairs to go through all the rows, it might also work to just grab index 1 by doing something like this: result["ID"][1] If that doesn't work, go for the loop method as seen in below example: for _, row in pairs(result) do outputChatBox(row["ID"]) end Assuming "ID" is the name of the column who's max value you want to retrieve and "result" is the result from your database (a table).
  15. The same performance are required no matter if it's loaded on the server or the client, however. A server with good performance could probably use this function to optimize a bit for the clients. If there are many online players it might slow down the server instead, I think it depends a lot on each individual case. Which of the server or client has most performance available to load maps, note that clients are a group of clients with various specifications on their hardware. The only way to find out is to try it and measure how much CPU time you need to load a relatively large map.
  16. Ubuntu server after installation: ~130MB RAM usage Debian after installation: ~29MB RAM usage Easy choice if your server has a low amount of RAM. Also, let's not forget that Ubuntu is based on Debian which is the reason why Debian is more light weight in general. Ubuntu may be a little more user friendly however.
  17. You mean bots? no those are not included in this pack of resources, this is just a couple of systems to manage police job, players wanted level, jail (including a map) and related stuff. You may have mixed up Grand Theft Walrus with GTW-RPG, they are related but not the same. All bots in Grand Theft Walrus, except for the trains and those who doesn't move are handled by a great resource named "npc_hlc", by CrystalMV. More info about that can be found here: http://crystalmv.net84.net/pages/scripts.php. Bots are off topic in this discussion though, if you wish to continue talking about bots you my do so in the GTW forum instead.
  18. Usually it's not the screen that is broken but the contact from your graphics to the main board, if your screen started to show red lines randomly a couple of weeks before it completely broke it's most likely the graphics. That's nothing you replace in a laptop tho but there is a trick that usually works, open it up and pick out the main board, leave the CPU and GPU on it but remove the memory, hard drives and other loose components, then put it in the oven at 200 degrees Celsius for 8-9 minutes. That should fix the broken circuits. Linux is a great idea here, but using Ubuntu with a desktop that takes 500MB RAM is pretty useless when you don't even have a screen. Ubuntu server might be a better choice with it's ~50MB usage. You may connect an external screen while installing tho until ssh is setup so you can login remotely using an ssh client like Putty if you're on Windows. Using it as a server usually gives more balanced performance usage than as a client, with those specifications given the risk of overheating is pretty low, however keep it away from anything that may burn. Even if it never get's overheated the temperature may still be high enough for some materials to burn. There are 2 rules to remember here, heat goes up and don't block the fans, they need a lot of room to remove out the heat.
  19. It's probably related to player ID's as it seems to loop through the array with the length defined as the player count, let's say there are three players online, 1, 2 and 3, then the player with ID 2 leaves the server. When someone tries to query the list they see 2 players online but only player 1 is listed as there is no player 2. It's only a guess though. // Get player nicks vecPlayers.clear (); while ( i < nLength ) { std::string strPlayer; try { if ( ReadString ( strPlayer, szBuffer, i, nLength ) ) { // Remove color code, unless that results in an empty string SString strResult = RemoveColorCodes ( strPlayer.c_str () ); if ( strResult.length () == 0 ) strResult = strPlayer; if ( ( uiMasterServerSaysRestrictions & ASE_FLAG_PLAYER_LIST ) == false ) vecPlayers.push_back ( strResult ); } } catch ( ... ) { // yeah that's what I thought. return false; } } Here's the code: starting at line 602. https://github.com/multitheftauto/mtasa-blue/blob/master/MTA10/core/CServerList.cpp
  20. There is one up and running but it doesn't follow the standard variable names yet, which may cause conflicts with other resources. We're working on it tho, here's a preview of that: It comes with online stat's as well.
  21. Donations is not a legal way to sell advantages in game as it's technically a purchase and not a donation if the donator get's anything in return. To accept donations there are various payment services like Paypal, allowing you to add a donation button on a html/php page on your webserver, Bitcoin and Litecoin works as well as the user only needs a receive address to your wallet to donate. To make your own system you need some PHP knowledge rather than Lua knowledge.
  22. Topic updated with working urls.
  23. I recomend you to check this out, if you haven't done it already.
  24. Performance is usually the least important aspect when it comes to running your own server, what you need to do is to ask yourself how much uptime you need, close to 100% or only daytime (~60%). Is it a laptop or a desktop machine (laptops needs better cooling). What type of network do you have (wireless or cable). A wireless network gives terrible ping to your clients, proceed only if it's plugged in by a network cable. Another thing is what you're going to use this machine for more than running your mta server on it. Using a regular windows client as host is often a pretty bad idea, I would rather recommend using an older machine with a real server operating system on it (there are free Linux distributions for this purpose allowing you to run your server for months without maintenance). Remaining parts of the network is also interesting, what kind of router do you have, a home router can get really hot if there's a lot of traffic coming by. How are you going to cool it down? a large heat sink may be required to solve this problem. You must also consider the risk of fire, you can't remove the oxygen in the air or the heat from your server. You need to place your server somewhere isolated by metal or concre, anything that can't burn. I'm only saying this because I know a few idiots who left their home server (laptop) on a couch or in their bed. They're homeless today. Alright, let's talk about the positive stuff, the profits, which is mainly the money you save. But only if you manage to solve above issues with hardware you already own, buying new hardware to setup a server is expensive and if that's required it's usually better to let someone else host it for you.
×
×
  • Create New...